w3c / csswg-drafts

CSS Working Group Editor Drafts
https://drafts.csswg.org/
Other
4.46k stars 657 forks source link

[css-color-5] How should negative percentages behave in color-mix()? #6047

Closed weinig closed 3 years ago

weinig commented 3 years ago

In CSS Color 5's color-mix() function, https://drafts.csswg.org/css-color-5/#color-mix, what should happen if a negative percentage is passed either as lone percentage or to an adjuster. For example, what should the behavior of the following two examples be:

color-mix(lch, red -10%, blue);
color-mix(lch, red hue -10%, blue);

In the investigative implementation in WebKit, I have implemented it as clamping to 0% in this case, but would like further clarity. Another, perhaps better, interpretation would be to keep it -10%, and use 110% of the hue of blue?

In general, being specific about values less than 0 and greater than 100 would be useful.