Live data from Hacker News

What are OKLCH colors?

jakub.kr

81–90 of 189 posts

Re: What are OKLCH colors?

#81
post #40

On the comparison between Color spaces, it's weird, my monitor from 2008 does show a difference between the Display-P3 and the sRGB purple colors, yet I didn't think it'd have such a big color range. Is there some color conversion at the browser or OS-level? (my distro/desktop enables colormgr by default).

It’s just completely wrong. The first uses oklch(0.65 0.20 300), comfortably inside sRGB, not even at the boundary. The second uses oklch(0.65 0.28 300), which is well outside P3 and even Rec.2020. The smallest fix would be to make the second one oklch(0.65 0.2399 300) to bring it inside P3 so the demo doesn’t get slightly warped if Rec.2020-capable (not really necessary, but preferable, I’d say), and the first #a95e…

This should be fixed now as well!

Re: What are OKLCH colors?

#82
post #60

Earlier quoted context omitted.

Sort of off topic questions, do we have any upcoming colour space beyond BT2020, now that we soon have monitor that reach 100% BT2020. I did some search and it doesn't seems to be any.

For any really bigger color space, you would have to use more than 3 primary colors, which would increase a lot the cost. Moving the monochromatic BT.2020 colors from 630 nm, 532 nm and 467 nm could get a little increase in color space coverage, but at the expense of a lower efficiency in power consumption to brightness conversion. 467 nm is not a very pure blue, but the sensitivity of the eye drops very quickly in t…

>Any display with LEDs or quantum dots will never have really monochromatic primary colors

I was referring to the new RGB LED. From what I have read so far seems to be doing far better than LED or quantum dots.

But I guess we will have to settle with BT2100 then.

Re: What are OKLCH colors?

#83

The “Better Gradients” thing is dodgy. OKLCH is a polar coordinate space. Hue is angle in this space. So to interpolate hue from one angle to another, to get from one side of a circle to the other, you go round the edge. This leads to extreme examples like the one shown: linear-gradient(in oklch, #f0f, #0f0) You can also go round the circle the other way, which will take you via blue–aqua instead of via red–yellow: l…

For anyone else copy pasting the gradients into dev tools to look at them: The second one is missing the # sign on the first color. And yes, both oklch gradients look pretty weird while the oklab gradient looks nice (if you can accept it going through grey).

Can anyone share some images for those who don’t have dev tools to view them?

Re: What are OKLCH colors?

#84
post #60

Earlier quoted context omitted.

Sort of off topic questions, do we have any upcoming colour space beyond BT2020, now that we soon have monitor that reach 100% BT2020. I did some search and it doesn't seems to be any.

For any really bigger color space, you would have to use more than 3 primary colors, which would increase a lot the cost. Moving the monochromatic BT.2020 colors from 630 nm, 532 nm and 467 nm could get a little increase in color space coverage, but at the expense of a lower efficiency in power consumption to brightness conversion. 467 nm is not a very pure blue, but the sensitivity of the eye drops very quickly in t…

> For any really bigger color space, you would have to use more than 3 primary colors, which would increase a lot the cost.

Unless you want to make displays for the bees and birds (and the tiny alleged minority of human tetrachromats) that seems rather pointless. People with three color receptors are your customers, so that's driving the market.

I rather predict, future displays will further improve on contrast, including very bright (brilliant) sparks. Imagine an iPhone glittering like gold or diamonds ...

Re: What are OKLCH colors?

#85
post #80
post #72

Earlier quoted context omitted.

A good gradient is one that takes a perceptually uniform, and typically perceptually shortest, path. The OKLCH gradient isn't perceptual uniform and appears to take unnecessary detours through other hues.

One could also argue that the detour through other hues is necessary in this case to avoid going through grey.

Gray is arguably just another color, it’s not clear why you’d want to avoid it. How is going via red and yellow better than going via gray? Varying hue is often perceived as a larger change than varying saturation or lightness. A path going through several distinct hues is visually less uniform than one going through gray once.

Re: What are OKLCH colors?

#86
Why is there no documented formula to convert to from this color space? A quick google and the best I could find is this Gist[0]. Searching for Oklab has a Wikipedia page[1].

[0] https://gist.github.com/dkaraush/65d19d61396f5f3cd8ba7d1b4b3...

[1] https://en.wikipedia.org/wiki/Oklab_color_space

Re: What are OKLCH colors?

#87
> The way gradients work in OKLCH is pretty different compared to sRGB. In sRGB, gradients are calculated in red, green, and blue values, which often leads to muddy midpoints and uneven brightness.

I always understood those “muddy midpoints” as a failure to properly gamma correct the interpolation between two (s)RGB colors. Is that happening here, or is the mud coming from something else?

Re: What are OKLCH colors?

#88

Why is there no documented formula to convert to from this color space? A quick google and the best I could find is this Gist[0]. Searching for Oklab has a Wikipedia page[1]. [0] https://gist.github.com/dkaraush/65d19d61396f5f3cd8ba7d1b4b3... [1] https://en.wikipedia.org/wiki/Oklab_color_space

It looks to me that all the "magic" is in the matrices used for conversion between Oklab and sRGB. The final conversion between Oklab and Oklch is trivial, and is documented in your linked Wikipedia article.

Re: What are OKLCH colors?

#89

Why is there no documented formula to convert to from this color space? A quick google and the best I could find is this Gist[0]. Searching for Oklab has a Wikipedia page[1]. [0] https://gist.github.com/dkaraush/65d19d61396f5f3cd8ba7d1b4b3... [1] https://en.wikipedia.org/wiki/Oklab_color_space

OKLCh is the same space as OKLab, it's just polar coordinates versus rectangular coordinates.

Re: What are OKLCH colors?

#90
post #85
post #80

Earlier quoted context omitted.

One could also argue that the detour through other hues is necessary in this case to avoid going through grey.

Gray is arguably just another color, it’s not clear why you’d want to avoid it. How is going via red and yellow better than going via gray? Varying hue is often perceived as a larger change than varying saturation or lightness. A path going through several distinct hues is visually less uniform than one going through gray once.

Is gray perceived as "just another color" or where all colors go when desaturated? I assumed the latter, which would explain why to avoid it if one isn't playing with saturation.
Post reply on HN