Re: [csswg-drafts] [css-color-4] Need a future-proof way to adjust lightness of a color (#10110)

One option for fixing this would be to add more features to gamut mapping, to allow a user to specify a maximum gamut. This is discussed in [#10038](https://github.com/w3c/csswg-drafts/issues/10038)

Another option would be to expose the `okhsl` space as suggested in [#8659](https://github.com/w3c/csswg-drafts/issues/8659). This space has `s=100%` map to sRGB gamut and `L=100%` is always white. Values of `s>100%` can reach other gamuts, but it might be worth adding versions of this space where `s=100%` maps to P3 and Rec2020.

To work the above example on `okhsl`, we see that the desired behavior comes out naturally.
* We would express this as `okhsl(from color(srgb 1 0.09 0.54) h s 90%)`
* The original color, in oklch, is `okhsl(0deg 100% 59.67%)`
* So the resulting color is `okhsl(0deg 100% 90%)`
* Which is equivalent to `color(srgb 1 0.09 0.54)`
This resulting color is future-proof.

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


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

Received on Thursday, 21 March 2024 11:05:07 UTC