Color comparison in pixel shaders

I just want to add that if you want to find close color then you can treat it as point in 3d space and do something like if(distanceSquared(color1, color2) < 16)…