How to select vertices by their color?
It is a comparison issue.
col.data[l_ix].color == color

You can:
from mathutils import Vector

color = Vector((0, 1, 0, 0))

Then compare with:
color == Vector(col.data[l_ix].color)

Alternatively, to avoid rounding issues, define an epsilon and compare using:
(color - Vector(col.data[l_ix].color)).length_squared &lt; some_epsilon