@hipsterelectron @aeva What I want help with is tips about how to calculate this distance.
-
@hipsterelectron @aeva What I want help with is tips about how to calculate this distance. Clearly a major problem is that I am not using the absolute value between each color channel, but should I be using a different color gamut other than RGB? Such as HSL or something else?
-
@hipsterelectron @aeva What I want help with is tips about how to calculate this distance. Clearly a major problem is that I am not using the absolute value between each color channel, but should I be using a different color gamut other than RGB? Such as HSL or something else?
@benjistokman @hipsterelectron I'm guessing you most likely want a perceptual color space like oklab or cielab.
The math involved is very fiddly and easy to get wrong, but the CSS spec has useful reference examples https://www.w3.org/TR/css-color-4/#color-conversion-code
You can also copy my notes https://github.com/Aeva/mollytime/blob/f4fe01f4ca979a0d24a3e7a11f6a5b4049cb3ea3/src/colors.cpp#L349 (my re-implementation of the math outlined in the above CSS spec)