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
[css-color-5] For color-mix(), what should happen if you provide an adjuster without a paired percent? #6046
Comments
Hmmm.... IMO it should be 100% for the specified adjuster, and then ALL OTHER adjusters are 0%. Consider in an image editing application where you have a transfer mode for one layer to another, such as "lightness" where only the lightness attribute of the layer is applied to he underlying layer. |
I guess I should mention my preference as well. I don't see any reason for this to be valid at all. Seems like we should change the |
The handling of percentages is described in the list following "Arguments are normalized as follows:"
|
The case you are mentioning (adjuster is present, it has no percentage) seems to be item 2 in that list. But perhaps that wasn't clear? The intent is that you can do I'm fine requiring an explicit 50%, if we decide on that; or simply adding what I typed above as the first, simplest, example. |
The case I was referencing was a percentage after an adjuster, which I don't think item 2 refers to as item to states:
That said, since adjusters have been removed from color-mix(), the concern is no longer relevant. (Though, if color-adjusters are going to be used for color-adjust(), I think requiring the percentage probably does make sense. The spec is kind of in an odd state right now where color-adjust() references the color-adjuster production but it is no longer defined anywhere). I think we are good to close this issue. Thanks for reviewing it. |
Since per editor resolution we removed adjusters from |
In CSS Color 5's color-mix() function, https://drafts.csswg.org/css-color-5/#color-mix, what should happen if an adjuster is specified without a percentage. For example:
The grammar for color-adjuster allows this:
due to the "?" after , but I am unclear what the semantics are of that.
In my investigative implementation, I treat an adjuster without a percentage as equivalent to specifying 0% for that adjuster, so for the example above, it would be equivalent to:
but I am not convinced this is the intention of the spec authors.
The text was updated successfully, but these errors were encountered: