Re: [css3-images] Linear gradients feedback

On Aug 30, 2010, at 1:58 pm, Tab Atkins Jr. wrote:

> On Mon, Aug 30, 2010 at 1:36 PM, Simon Fraser <smfr@me.com> wrote:
>> On Aug 30, 2010, at 12:42 PM, Tab Atkins Jr. wrote:
>>> On Sun, Aug 29, 2010 at 3:14 PM, Simon Fraser <smfr@me.com> wrote:
>>>> A second reason to try to avoid these branches in the gradient algorithm is
>>>> because it makes interpolating between them for animation harder. Without a
>>>> canonical form, you can't map all inputs to a common representation
>>>> for interpolation.
>>> 
>>> Correct, you can't.  Angle-based gradients and no-angle gradients
>>> calculate their positions in fundamentally different ways which cannot
>>> be reconciled without losing information.  Angle-based gradients have
>>> an additional constraint that no-angle gradients don't have.  Even if
>>> we did define a shared default for the first <bg-position>, there is
>>> *no way* to define a default <angle> for both cases.  The mere
>>> presence of an <angle>, no matter the value, adds an additional
>>> constraint to how the gradient positions itself that can't be
>>> generally replicated in the two-point gradient.
>> 
>> Once we're able to do transitions/animations on gradients, I'd
>> like the story to be simple. If there are two forms of linear-gradient
>> that are not interpolatable, I think they should have different
>> function names, otherwise the spec that describes the transitions
>> will need a whole lot more "if that, then this" logic to specify
>> which interpolations are possible.
>> 
>> If you use different function names, then it's very easy to say
>> "transitions between different gradient functions are not possible".
> 
> I'm not opposed to this.  I just don't have any idea what sort of name
> would be appropriate for distinguishing angle and two-point gradients.
> If you've got any suggestions, I'm all ears.  ^_^

Glazou reminded me in a tweet of another good reason that we should
strive to keep the different-behaving functions separate: the CSS OM.
We need to design gradients such that the properties exposed in the OM
are sensible, and behave predictably under modification.

> Using a combination of two positions and an angle is awkward,
>> because one of the points may no longer lie on the gradient
>> axis. That's why the point/angle/length combination seems more
>> natural here.
> 
> Hmm, maybe.  If, as you say, we make percentages in the <length> refer
> to the distance from the starting-point to the "line intersecting the
> corner" point, and make it default to 100%, I think that could be
> okay.
> 
> I'd still want the starting-point to use the "corner in the opposite
> direction of the angle" smarts if left out, though.

I'm ok with both of those.

Simon

Received on Friday, 3 September 2010 15:00:33 UTC