-
Notifications
You must be signed in to change notification settings - Fork 688
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-transitions] Define interpolation of the currentcolor keyword #445
Comments
Note there was some discussion in the mailing list in this thread: https://lists.w3.org/Archives/Public/www-style/2016Apr/0281.html |
Currently, different engines have different behavior for different properties. In Gecko, on some properties like In Blink, as far as I can see, I'm trying to implement the ideal interpolation way (the way how Blink handles |
FWIW, the way we are implementing does not match how The issue with |
Linear interpolation is a reasonable assumption for all transitions, including for color. The issue is what color space to perform the linear interpolation in. |
FWIW, Gecko has implemented interpolation between "currentcolor" and numeric color for majority of CSS color properties (if not all). It does so via interpolating colors linearly in a way like "x% of rgba + (1-x%) of currentcolor". As far as I can see, this also matches how Blink interpolates them. |
Given the approximative interop we already have, this could probably be solved by adding the following sentence to the definition of color interpolation.
|
@frivoal That wouldn't be sufficient to handle, e.g.
We need to handle currentColor as a separate component, so that e.g. you have some percentage of currentColor plus an rgba component. (We could serialize this out using an |
Note that gCS returns used value for color properties, so syntax wouldn't be a problem for that case. But if we want to take Typed OM into account, maybe we need to resolve on a syntax. |
That link has gone cold; it looks like neither Transitions 1 nor Transitions 2 defines color interpolation. Where did it get moved to? |
Values and Units: https://drafts.csswg.org/css-values-4/#combine-colors |
Depends on #5392 |
Well, for now, I added the text suggested by @frivoal to the Interpolation section in CSS Color 5. Unlike the antique text in V&U it doesn't assume all colors are sRGB. Also, color interpolation is better being in a color spec. Is there anything useful from V&U combine colors that should be salvaged? |
@fantasai I do understand the issue you raise about keeping the currentColor contribution separate so that it can be re-evaluated. But that isn't what is currently implemented, so for now at least documenting what we have is one step closed. |
The Interpolation section in CSS Color 5 now also includes interpolation with alpha; but still assumes that Unlike what is in V&U, there is no assumption of sRGB. If there is only one special keyword, handling it isn't too bad. If we also need to consider the percentage of system colors, or add new functionality like |
(Removing css-color4 tag, therefore) |
Interpolation happens on computed values:
https://drafts.csswg.org/css-transitions/#transitions
The computed value for
<color>
is either a RGBA color orcurrentcolor
:https://drafts.csswg.org/css-color/#currentcolor-color
When defining how to interpolate
<color>
, css-transitions seems to assume it can only be an RGBA color:https://drafts.csswg.org/css-transitions/#interpolated-types
The section in this last quote should define how
currentcolor
interpolates. Is it not interpolate, or should it be substituted by the value ofcolor
(which itself might be animated or transitioning) for the purpose of interpolation?CC @Manishearth, @upsuper
The text was updated successfully, but these errors were encountered: