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?
Edit: A more prominent example is color(xyz-d65 1 1 1), which can't be exactly represented in Lab without a lightness above 100% because Lab uses a d50 whitepoint.
It's possible for a color conversion to result in negative lightness. For example, the color
lab(1% 60 100)is naively equivalent tooklab(-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?
Edit: A more prominent example is
color(xyz-d65 1 1 1), which can't be exactly represented in Lab without a lightness above 100% because Lab uses a d50 whitepoint.