Re: [css-images] color-stop position interpolation

Le 19/08/2013 19:14, Tab Atkins Jr. a écrit :
> On Mon, Aug 19, 2013 at 10:59 AM, Simon Sapin <simon.sapin@exyr.org> wrote:
>> Le 19/08/2013 07:15, Dirk Schulze a écrit :
>>> The animation on the <angle> component for linear gradients is not
>>> problematic because the keywords are fixed to certain angles.
>>
>> Keywords for corners such as "to top left" are not.
>
> Correct.  However, Shane Stephens (Google) proposed some time ago a
> slightly different interpolation behavior for linear gradients than
> what we currently have, where you interpolate the angle+length of the
> gradient line itself, adjusting stops as appropriate to do so.  This
> not only handles interpolation between keywords and angles, it also
> produces smooth transitions regardless of what you specify (just
> transitioning angle can make the gradient seem to grow and shrink
> during a single rotation).

FWIW, the distance from the center to a percentage stop position in a 
linear gradient is proportional to:

   abs(width * sin(angle)) + abs(height * cos(angle))

Which looks like this when changing the angle with a fixed percentage 
position:

https://www.wolframalpha.com/input/?i=polar+plot+abs%284*cos%28a%29%29+%2B+abs%283*sin%28a%29%29%2C+a+%3D+0+to+2*pi

I agree that animations might look better when interpolating absolute 
lengths rather than following the above.

-- 
Simon Sapin

Received on Monday, 19 August 2013 18:59:25 UTC