Ask HN: Anybody know how to compare two colors in JS?
Given two hex colors (eg: #ccc and #999), what is the best way to compare the colors in JS? Need to return an int 0...n (where 0 is exact match).
I have tried converting to decimal and checking the difference...but this isn't ideal. Couldn't find much on Google either.