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

On Mon, Aug 19, 2013 at 11:59 AM, Simon Sapin <simon.sapin@exyr.org> wrote:
> 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.

Hah, cool graph.  To be specific, the graph represents the positions
of the 0%/100% color-stops in a 4:3 ratio box as you rotate - just
draw a line through the origin at a given angle, and where it
intercepts that curve are the stop locations.

~TJ

Received on Monday, 19 August 2013 21:15:56 UTC