Re: [csswg-drafts] [css-color-4] Expected behavior around lightness 0 or 100% in Oklab/Oklch/Lab/LCH? (#10109)

@facelessuser wrote:

> > The main question remains of what behavior is desirable at or close to 100%.
> 
> No matter what you do in terms of gamut mapping, you are wrong. All you can do is find the "best" possible color based on how you are working and what attributes you deem most important because you can't represent all the attributes of that color.

This is a very important observation. This is an "impossible problem", of the form "how do we make sense out of nonsensical inputs?".

The true plane of `L=100%` in `oklch` is something that is indeed not `white`. Here's an image of what this plane looks like next to the sRGB gamut (produced using [this demo](https://ccameron-chromium.github.io/webgl-examples/gamut.html) that I brought to show at TPAC to try to move this conversation forward). The background color of the image is `white`, and only the portions of the plane that can be produced on HDR P3 displays are shown. What is notable is that the `L=100%` plane is indeed bright and extremely colorful.
![srgb-gamut-L1-plane](https://github.com/w3c/csswg-drafts/assets/32557109/746852c9-acfb-4fb6-9972-7a2c93b17615)

The true plane of `L=0%` in `oklch` consists entirely of imaginary colors (nonsensical color values that cannot ever be produced in reality), except at the point `(0,0,0)` (which is indeed `black`).

I would like to focus our efforts on providing a space like `okhsl`/`okhsl-p3`/`okhsl-rec2020` as you've worked out over in #8659. In those spaces `L=0%` is indeed `black` and `L=100%` is indeed `white`. That way we can avoid nonsensical inputs, rather than encourage nonsensical inputs and then argue over how best to interpret nonsense inputs.

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


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

Received on Tuesday, 26 March 2024 16:01:14 UTC