Re: [css-images] transition of repeating gradients

On Sat, Aug 17, 2013 at 10:37 PM, Dirk Schulze <dschulze@adobe.com> wrote:
> The spec says to transition of repeating gradients[1]:
>
> ""
> Both the starting and ending gradient must have the same number of <color-stop>s. For this purpose, a repeating gradient is considered to have infinite <color-stop>s, and thus all repeating gradients have the same number of <color-stop>s. (Note that one may pad a gradient with additional <color-stop>s placed atop each other, if necessary to make two gradients have the same number of <color-stop>s.)
> ""
>
> Could the spec instead define that the number of specified color stops per iteration between start and end gradient must match each other? I think it is confusing to say here that repeating gradients always have the same number of color stops. Otherwise implementations would need to support animations between all kind color stop lists for repeating gradients.

You just do the same thing as with, say, mismatched lists of
animation-* properties - find the LCM of the two lists, repeat each
out to that length, then interpolate appropriately.

That is, interpolating between:

    repeating-linear-gradient(white, black)

and

    repeating-linear-gradient(red, green, blue)

is identical to interpolating between:

    repeating-linear-gradient(white, black 100%, white 100%, black
200%, white 200%, black 300%)

and

    repeating-linear-gradient(red, green, blue 100%, red 100%, green
150%, blue 200%)

which do have the same number of stops.

> The note at the end actually suggest that implementations "add" color stops to the gradient so that the number of color stops match between start and end, while the first sentence requires the same length in the first place.

No, the note at the end is for authors.  There's no requirements or
instructions anywhere in that sentence to suggest that UAs do
anything.

Though I do notice I accidentally used a "may" there.  I'll switch it
to Note styling and remove the accidental 2119 terminology.

~TJ

Received on Monday, 19 August 2013 21:28:45 UTC