Re: [csswg-drafts] [css-color] Computing lch/lab to srgb with lightness = 0% or 100% (#8794)

> What would be the lab representation of color(xyz-d50 0 1 0), if not lab(100% -431.0345 172.4138)?

If the powerless logic in CSS is to be followed, I imagine that the Lab value for this would be `lab(100% 0 0)`. Keep in mind that once a color is that bright, you really aren't seeing the chroma, just the lightness.  If you clip that color in sRGB, you may get a color, but that is just because you are loosing color information in the clip. The reality is that these high chroma colors are out of gamut, and I agree that the most appropriate "in gamut" color for this is white. What I find odd about the CSS requirement is that it imposes a partial gamut correction, but only when lightness is 0 or 1, and before the final, displayable color is ready to be gamut mapped/clipped. I guess, my feeling is simply why bother correcting in these two scenarios, but nowhere else? This is really a gamut problem which is why I think leaving it to gamut mapping/clipping makes the most sense instead of a partial solution in the conversion algorithm.

I also don't think it completely harmless if we consider some interpolation cases. Consider this example where we attempt to interpolate only lightness of two Lab colors in Oklab. In the first example, we do not enforce the CSS powerless requirement during conversion and get a colored gradient (gamut mapping the final results), but if we use the CSS requirement, we get a grayscale interpolation.

![interpolate](https://github.com/w3c/csswg-drafts/assets/1055125/8535b565-67f2-4e37-b871-af29b65307c9)

If we impose this requirement now, will it be relaxed when/if we get true gamut mapping (if not in level 4 maybe Level 5)? Or once it is in the spec, will it remain for backwards compatibility? Do we even care about the above interpolation use cases? While I personally think it makes sense to keep a separation between conversion and gamut mapping/clipping, this may not be CSS's goal, but I figured it is worth bringing up as a talking point before a decision is forever in place.


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


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

Received on Wednesday, 10 May 2023 21:38:55 UTC