[csswg-drafts] [css-color-4] How to handle conversions that result in negative lightness? (#9484)

nex3 has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-color-4] How to handle conversions that result in negative lightness? ==
It's possible for a color conversion to result in negative lightness. For example, the color `lab(1% 60 100)` is naively equivalent to `oklab(-4.8743815325% 0.7106198377 0.1847214228)`. Negative lightnesses are generally disallowed, but the spec is only explicit that they should be clamped _at parsed-value time_, which leaves it ambiguous what to do when they come up as the result of a conversion.

It's not clear to me what the right solution is here. If you clamp eagerly, you break the ability to round-trip safely between Lab and OKLab. Clamping at parsed-value time means that there are valid Lab colors which can't be represented in OKLab. Is this acceptable? If not, how should it be solved?

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9484 using your GitHub account


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

Received on Wednesday, 18 October 2023 01:34:55 UTC