[csswg-drafts] [css-animations] Add control of colorspace used for animating colors (#7062)

svgeesus has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-animations] Add control of colorspace used for animating colors ==
( 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:

- to avoid needless conversion to sRGB, dropping the more saturated colors
- because interpolating in gamma-encoded space gives overly dark midpoint colors
- because some color spaces give better results than others, which kind of varies depending what the start and end colors are, so stylesheet authors need the flexibility to choose.

As this is a common requirement, [CSS Color 4 defines a `<color-interpolation-method>`  token](https://drafts.csswg.org/css-color-4/#interpolation-space) and associated color interpolation math;  this has already been used in [the grammar for `color-mix() in CSS Color 5](https://drafts.csswg.org/css-color-5/#color-mix) and in [linear, radial and conic gradients in CSS Images 4](https://drafts.csswg.org/css-images-4/#gradient-colors).

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.


Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7062 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 16 February 2022 17:48:20 UTC