3 ms·
> Some of the code I came across while searching for an RGB > HSL solution > But the calculation for converting sRGB colors to HSL I don’t know whether you’re
by Someone 5y ago
> Some of the code I came across while searching for an RGB > HSL solution
> But the calculation for converting sRGB colors to HSL
I don’t know whether you’re aware, but RGB and sRGB are different things. sRGB is device-independent, RGB is device-dependent. Depending on what the values in the RGB you have mean, that may or may not involve ‘not pleasant’ code.
(Color is one of the items on the long list of things to try to avoid when programming. A few of the other items on that list are Unicode, dates and times, multi-threading and floating point. All have standards that aren’t pleasant, but also the most pleasant we have available)
- rikroots 5y ago> Color is one of the items on the long list of things to try to avoid when programming. Too late. I got annoyed by the lack of support for HWB, LCH and LAB in Chrome/Firefox. Safari now supports them for CSS, but has not yet made the effort to support them in the canvas element. I wanted users of my JS canvas library to be able to fill and stroke things using any valid CSS color string ... so I've been doing the work to make it happen over the holidays. It's been worth the effort. Red > Blue gradients look so, so much better when using LAB color space values, compared to what you normally get using RGB.