Re: [csswg-drafts] [css-color] How to handle out-of-bounds legacy srgb values? (#10087)

> * Why does `color-mix()` prevent me from picking a percentage outside of the 0-100% range, if I can do the mix with arbitrary values via animations/transitions (but it's much less convenient)?

Short answer: because we [resolved](https://github.com/w3c/csswg-drafts/issues/6047#issuecomment-811218918) it that way

 - https://github.com/w3c/csswg-drafts/issues/6047

Longer answer: because [I argued](https://github.com/w3c/csswg-drafts/issues/6047#issuecomment-790180751), not once but [multiple times](https://github.com/w3c/csswg-drafts/issues/6047#issuecomment-791802138) that negative values were useful and meaningful (mixing a color with -10% of another color is trivial mathematically), but most people could not understand how they would work, "just assumed" negative values were meaningless and nonsensical, thought it would confuse authors, or drew on analogies with mixing paints or of compositing with `cross-fade`; so there we are. 

Also because the legacy `rgb()` and `rgba()` syntaxes have always clamped out of range values.

I still think it was the wrong decision, technically. But it is, sadly, a bit late to change that now that there may be deployed content that depends on the behavior.  Which means, as you said, that `color-mix` can't do it but more involved strategies involving animations or transitions can be used to do it. Which will be confusing for authors.


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


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

Received on Monday, 10 June 2024 18:22:02 UTC