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

One thing to consider, Okhsl, while fine for selecting colors, is not a good color space to work in for things like gradients. There is still utility in using OkLCh, even if defining nonsense inputs is difficult.

Okhsl will keep you, roughly, in gamut if you operate in its bounds, but the useable results are not great. I've taken out GMA, and will just use naive clipping. This example shows the lack luster results of Okhsl is in regard to gradients. OkLCh just does better, and even if you only operate in the non-polar OkLab, you still go out of gamut at times, though admittedly less severe.

[Example](https://facelessuser.github.io/coloraide/playground/?code=from%20coloraide%2eeverything%20import%20ColorAll%20as%20Base%0Aclass%20Color%28Base%29%3A%0A%20%20%20%20FIT%20%3D%20%27clip%27%0AColor%2einterpolate%28%5B%27orange%27%2C%20%27blue%27%2C%20%27green%27%5D%2C%20space%3D%27oklch%27%29%0AColor%2einterpolate%28%5B%27orange%27%2C%20%27blue%27%2C%20%27green%27%5D%2C%20space%3D%27okhsl%27%29%0AColor%2einterpolate%28%5B%27white%27%2C%20%27blue%27%2C%20%27black%27%5D%2C%20space%3D%27oklch%27%29%0AColor%2einterpolate%28%5B%27white%27%2C%20%27blue%27%2C%20%27black%27%5D%2C%20space%3D%27okhsl%27%29%0AColor%2einterpolate%28%5B%27oklch%280%2e63%200%2e26%200%29%27%2C%20%27oklch%280%2e63%200%2e26%20360%29%27%5D%2C%20space%3D%27oklch%27%2C%20hue%3D%27longer%27%29%0AColor%2einterpolate%28%5B%27color%28--okhsl%200%201%200%2e5%29%27%2C%20%27color%28--okhsl%20360%201%200%2e5%29%27%5D%2C%20space%3D%27okhsl%27%2C%20hue%3D%27longer%27%29)

<img width="1332" alt="Screenshot 2024-03-26 at 10 36 53 AM" src="https://github.com/w3c/csswg-drafts/assets/1055125/7d0706d5-9e77-4341-bdcf-0dad0757a0ba">


-- 
GitHub Notification of comment by facelessuser
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10109#issuecomment-2020960907 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:45:16 UTC