-
Notifications
You must be signed in to change notification settings - Fork 711
[css-color-5] Omitted adjuster logic for color-mix() #5279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What do y'all think about a missing percentage meaning
^ thoughts on that? would mean one of the colors could own/steal a whole channel, since Another potential issue: |
upon review, my above comment looks like an extension on #4711 (comment) |
the logic for color stop resolution feels similar https://www.w3.org/TR/css-images-3/#color-stop-fixup |
I agree that the first stage is a distribution solution, for any missing values. The second stage though is a scaling one, because the explicit and implicit percentages need to sum to 100% and if they don't, they are scaled. |
scale up or down, depending on a shortage or overflow. sounds good to me! |
I see this old issue is still open, but is now completely specified in Percentage Normalization |
Based on various examples in the spec and in issues, it appears that if any adjusters are present, the remaining adjusters default to 0%, i.e. the whole component of the other color. However, this was not actually part of the prose, so I've done some work to add this logic alongside other editing to flesh out how this is supposed to work. However, since per #5258 we can have percentages and adjusters on each color, this becomes trickier.
I've written a list of steps to normalize the arguments to a list of adjusters, to make it more predictable how they combine (especially when combining percentages and adjusters), so it can pave the way to multiple colors. It currently says:
However, this would mean that e.g.
color-mix(color1 hue 20%, color2 chroma 20%)
becomescolor-mix(color1 hue 20% chroma 80% lightness 0%, color2 hue 80% chroma 20% lightness 0%)
when normalized, which I suppose we could define the scaling algorithm so that equal percentages end up being normalized tolightness 50%
, but still.And while we're at it, what would missing percentages default to? I.e. what is
color-mix(color1 hue, color2)
?cc @svgeesus @una @argyleink
The text was updated successfully, but these errors were encountered: