Hacker News new | past | comments | ask | show | jobs | submit login

> Not only are perceptual uniform models like CIE Lab*, and the derived CIELCh or CIEHLC mindbending to understand and code

Conversion from srgb to lab and back (through xyz) is a handful of functions, all under a dozen lines of javascript. Lab to lch and back are a pair of functions, about two lines of code each.

If you're implementing a user interface with sliders, you might also want to clamp the values to avoid producing out of gamut colours. The weird shape is probably the hardest thing to understand (user point of view), but the controls remain very intuitive.




I should have phrased it better. Teenage me struggled, but I haven't attempted it since. Having said that, HSL/HSV worked well enough, and monitors now have better colour accuracy and wider colour gamut. Back then, people were still using "web-safe" colours.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: