W3C home > Mailing lists > Public > www-style@w3.org > August 2010

Re: [css3-images] Linear gradients feedback

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 30 Aug 2010 13:58:32 -0700
Message-ID: <AANLkTimroHKby=Hm6nZdgZzvOek9AJU56LH6pJwz3UcB@mail.gmail.com>
To: Simon Fraser <smfr@me.com>
Cc: www-style list <www-style@w3.org>
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.  ^_^


> 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.

~TJ
Received on Monday, 30 August 2010 20:59:24 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:30 GMT