Re: [css3-transitions] Interpolating between values from different information sources

On Mon, Nov 1, 2010 at 2:17 PM, Brad Kemper <brad.kemper@gmail.com> wrote:
> On Nov 1, 2010, at 10:51 AM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:
>> Another possibility is to split linear gradients into two functions,
>> one of which takes an angle and the other takes a point.  That would
>> solve the issue fairly neatly without complicating the model with extra
>> power, but (a) the two types of gradients *should* be interpolable, and
>> (b) I don't think this solution is extendable to radial gradients.  I'd
>> like radial gradient and linear gradients to be addressed with a similar
>> solution if at all possible.
>
> My point with my proposed changes is that the <bg-position> syntax is almost completely superfluous for linear gradients. The one thing it does have is the ability to have a diagonal gradient that conforms to the box size (as they do in other image formats). But that minority use case can be handled much more simply and cleanly with a keyword, rather than with a whole different syntax that requires the color-stops to be remapped to (or possibly overlaid on) a different pair pair of points. The other use case for the <bg-position> syntax, exactly aligning the ends of a gradient with something else, is such a tiny special edge use, with other adequate ways of handling that, and doesn't warrant the extra syntax either.

I agree.  I believe that 95% of all cases can be addressed with one of
two things: an angle, or a box-cardinal direction (two horizontal, two
vertical, four corner-to-corner).

The specific idea I came up with lets us address both of those in a
consistent way together, such that you can always interpolate between
the two.  You can't do that with an explicit switch between two
different behaviors.


> Radial gradients are a different animal. I would expect the color-stops part to be the same, but not the part for setting the center of the radial.

Right; they aren't the same now, and I don't expect them to be the
same in the future.  What I meant was just that whatever I end up
needing to do to make linear gradients always interpolable, I'd like
to do for radial gradients too.

I'll note an additional option for interpolating between gradients -
just give up on intermediate forms.  When you're 30% done with
transitioning between two gradients, it could be represented by
"interpolate(gradient1,gradient2,30%)".  It's an end-run around the
problem, but it *is* a solution.

~TJ

Received on Monday, 1 November 2010 23:11:23 UTC