7 ms·
This is one of those "do we really need to do this" type of things. If you go and play with an OKLCH tool like this one, you'll notice that the differences in t
by rglover 2y ago
This is one of those "do we really need to do this" type of things. If you go and play with an OKLCH tool like this one, you'll notice that the differences in the OKLCH vs RGB/hex color are imperceptible: https://oklch.com/#65.88,0.2097,41.29,100 https://oklch.com/#65.88,0.2097,41.29,100.
- psygn89 2y agoThe benefit of OKLCH is that it normalizes the colors to our perception. So a saturation % change in OKLCH is more of what we'd expect than in HSL. This is good for design systems that want to have a visually expected output after running it through a color function. See the part on https://evilmartians.com/chronicles/oklch-in-css-why-quit-rgb-hsl#oklch-vs-hsl https://evilmartians.com/chronicles/oklch-in-css-why-quit-rg... and notice the cut out in the right column. Now pretend to stretch those cutouts to fit the edges of the chart, you'll have a color gradient that is more uniform across the board versus the left where you have darker areas.
- throwaway743950 2y agoThere are cases of perceivable differences though like https://oklch.com/#70.29,0.2413,41.29,100 https://oklch.com/#70.29,0.2413,41.29,100 .
- deleted 2y ago[deleted]
- sureIy 2y agoThe advantage of OKLCH is not that it produces better colors, it's that you can vary a color reliably. They sold HSL to us as a way to vary the hue easily in a way that's not possible with #000000 without manually computing it first. The reality is that the hue parameter in HSL also considerably changes the luminosity of the color. The tool you linked only demonstrates that OKLCH can also display colors that rgb() can't, but most of them are the same.
- mtgentry 2y agoThe gamut is much wider
- out-of-ideas 2y agoseriously reminds me of https://xkcd.com/927/ https://xkcd.com/927/ if im doing color-anything, i do enjoy manipulating the raw colors over any integer representation of them, then sending whatever code i need back to whatever. im more irk'd at the main linked page, shows up nice and dark background, then scroll down a hair and its back to staring at the day-star, ie white background and eye killer. why oh why? ha, if i scroll up and down fast enough its like a strobe light. weeeee. and there was another HN page related to oklch themes yesterday that did the same thing; making me improperly biased already. please folks, dont make a mess of my dark mode