nicholas-miklaucic / scarlet

Colors and color spaces made simple, for Rustaceans.
Apache License 2.0
23 stars 6 forks source link

Form of perceptual equality or approximate equality #3

Closed nicholas-miklaucic closed 6 years ago

nicholas-miklaucic commented 6 years ago

Color::distance is already implemented, which gives a perceptual analog for color distance. It'd be helpful to have some sort of equality metric that uses this, perhaps both for exact equality and approximate equality.

The reason for this is because for chrominance-value spaces, like HSL and CIELCH, hue doesn't matter if the lightness is either black or white, so the hue value doesn't matter for equality metrics. Floating-point means that direct equality isn't super useful, though: perhaps it'd be best to do approximate equality using the XYZ method?

nicholas-miklaucic commented 6 years ago

Actually pretty much done, nvm