Re: [csswg-drafts] [css-color-4] (ok)lch implementations break the entire purpose for authors (#9449)

> > The difficulty with the oklab and oklch space is that, when used correctly, they produce extremely out-of-gamut colors.
> 
> This is factually incorrect. Highly out of gamut colors can be produced in pretty much any colorspace, including sRGB.

I think that the difference is whether or not it is obvious to the content author when they are entering the danger zone.

If specifying colors in an RGB color space, there's the clear signal that "if the parameters are outside of the [0,1] interval, then I'm playing with fire". True, one can specify `color(srgb 0 -1 999)`, but it's clear that that is to set oneself up for a bad day.

Meanwhile, in something like `oklab` and `oklch`, the guardrails are less obvious. In the example from the codepen, the endpoints are `oklch(90% 10% 0deg)` and `oklch(90% 90% 0deg)`. One of these is in the sRGB gamut and the other one is way outside of the the gamut of any existing monitor. Which is which? It's not obvious just by reading them.

It turns out that `oklch(90% 90% 0deg)` is the one that is way far outside of the gamut of what any existing monitor can produce. It's equivalent to `color(rec2020 1.295 0.434 0.797)`.

For this reason, I think that we should provide content authors with a space that is perceptually uniform but does not suffer from this problem. A cylindrical space something like [okhsl](https://bottosson.github.io/posts/colorpicker/) would be nice. (That particular formulation is very tightly tied to the sRGB gamut, so it won't do as a verbatim drop-in). The CSS gamut mapping algorithm has the effect of cylinder-ifying the `oklab` and `oklch` spaces.

-- 
GitHub Notification of comment by ccameron-chromium
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9449#issuecomment-1898405829 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 18 January 2024 12:39:54 UTC