[css-color-5] clipping of component values in RCS #9259
Labels
Closed as Question Answered
Used when the issue is more of a question than a problem, and it's been answered.
css-color-5
Color modification
Uh oh!
There was an error while loading. Please reload this page.
In #8444 it was resolved to allow out of gamut colors for
rgb
,hsl
andhwb
and to let them round trip ascolor(...)
functions.This surfaced some things which I now think are just bugs in our implementation.
When parsing any color we clip specific components.
hsl(50deg -10% 50%)
is clipped to0%
saturation.https://www.w3.org/TR/css-color-3/#hsl-color
But these steps are parsed-value time and we also do these steps for RCS when computing the values for specific channel keywords. I think that is obviously incorrect and we should fix this.
However I was wondering if there are now also other ways users can force
rgb
,hsl
andhwb
to produce colors that are outside the rgb gamut?For example :
color: hsl(from white 311.21deg -5.5486% 1.0906%);
This can be trivially clipped at parsed-value time, but is it really different from
hsl(from lab(0 104.3 -50.9) h s l)
?Some variants :
The text was updated successfully, but these errors were encountered: