-
Notifications
You must be signed in to change notification settings - Fork 714
[css-color-5] How should missing (none
) components work with calc() on named components in the relative color syntax
#6920
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
I think this is already explicit:
There is no "other color" here so we have However, in your example the color starts as Lab and remains as Lab so "converting it to another color space" does not apply. Bur "etc" could usefully change to "performing computations on the color component values, etc" |
Also you raise a good point about whether we have |
There is a small argument for having some way to preserve the "missing" concept into lab(from var(--my-color)
calc((1 - var(--progress-l)) * l + (var(--progress-l) * var(--other-color-l))
calc((1 - var(--progress-a)) * a + (var(--progress-a) * var(--other-color-a))
calc((1 - var(--progress-b)) * b + (var(--progress-b) * var(--other-color-b)) ); In the above, if one of the components was 'none', what the user probably really wanted was to just the other component, but if they always lose that information they are out of luck. Admittedly, this example seems a bit far fetched and would probably require some new functionality in calc to conditionally do the behavior wanted, but I thought I would call it out in case you had any interesting ideas here. (Unrelated, should calc() have a |
|
With the addition of missing components to colors, it would be good to clarify what the behavior is when a missing component is used in a relative color when combined with calc(). For instance:
It would make sense to me that
l
anda
remainnone
here, but I am less clear on what the specified behavior ofb
should be. Conversion to 0 like done at rendering? Conversion to NaN? Remainnone
and be invalid?The text was updated successfully, but these errors were encountered: