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


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. (11.7 KB) (11.7 KB)

Sorting the resulting lines is a separate matter.