Cull last item, then first item, then last and so on

Hi,

I am quite new to Grasshopper so it might be an easy question:

I would like to create lines between the points having the same color. Do to so I would like to cull every item that is not highlighted by a color. Is that possible in a clean way?

Thanks in advance.

Points.gh (11.7 KB)


Points_2021Oct11a.gh (11.7 KB)

Sorting the resulting lines is a separate matter.