-
Notifications
You must be signed in to change notification settings - Fork 691
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-animations] Add control of colorspace used for animating colors #7062
Comments
Is there a need to interpolate in a different colorspace per transition/animation? Or would it be acceptable to say that all animations/transitions on an element always use the same colorspace? If it's the former, then this will need to be defined at the Web Animations level and mapped to corresponding properties in CSS animations/transitions. If it's the latter, then perhaps we could use a generic property similar to SVG's
I'm afraid this still hits the issue where we can't easily add new keywords to the |
Yes. For maximal Web compat, existing animations need to continue to animate in gamma-encodes sRGB space; yet animations using other, wider gamut color spaces would be severely hampered by being forced to do so. Also, stylesheet authors may choose to use different colorspaces on different animations or transitions depending on the effect they want to achieve.
So, this means that authors would need to use the animation shorthand to set most of the animation, then a longhand to set the animation colorspace?
Could you unpack that a bit more for me, so I have a clearer idea of what to do next? |
I don't quite follow the Web compat angle. I assumed this property was acting as an opt-in to use a different colorspace for interpolation for the element(s) it is applied to? Then again, I think my question was poor. I'm curious if, for a given element, there is a need to apply a different colorspace for different animations/transitions.
I can see that would give more flexibility, I'm just wondering if in practice it's needed since it might be simpler if it's not (that is, if authors only ever need to specify one interpolation colorspace per element). But perhaps the Web compat aspect makes this point moot.
Yes, either that or we find a way to somehow add keywords to the
I think we'll need to determine first:
If it's the former, we'll want to add a special property like we already have for If it's the latter, then I imagine we'll extend the definition of keyframe effects, perhaps with a section on "interpolation parameters" or the like defining an "interpolation colorspace" parameter or such in the model along with its default value. Then we'd add a suitable IDL member to In either case, then we'd finally need to indicate the mapping between the CSS property and the Web Animations model concept in CSS Animations 2 / CSS Transitions 2 (e.g. the mapping for animation-duration). For the former case where we allow different colorspaces per interpolation interval, we'd also need to add some prose explaining how to build up the keyframes for a CSS animation in this section. |
I agree that we want to have the same solution for animations and for transitions, so closing this in favor of #7063 makes sense. |
( Spun out from #7035 )
Currently, all animation of color happens in gamma-encoded sRGB space. There is a need to preserve this as a default, for Web compat. However, CSS Color 4 defines a bunch of other color models, which exceed the very limited gamut of sRGB, and there is a need to add control of the color space used for interpolation which is currently unspecified:
As this is a common requirement, CSS Color 4 defines a
<color-interpolation-method>
token and associated color interpolation math; this has already been used in the grammar for `color-mix() in CSS Color 5 and in linear, radial and conic gradients in CSS Images 4.So this issue proposes to add a new property, initial value
auto
:animation-interpolation: [ auto | <color-interpolation-method> ]#
and also to add this to the animation shorthand. There is no ambiguity (unlike time) so it can go in any order in the shorthand.
The text was updated successfully, but these errors were encountered: