W3C home > Mailing lists > Public > www-style@w3.org > September 2014

Re: [css-image] gradient midpoints

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 29 Sep 2014 10:47:51 -0700
Message-ID: <CAAWBYDDzFvVKxW_JHekwVQ4XiL8oyN-Rz6-tDqf5iPqgws+umQ@mail.gmail.com>
To: Rik Cabanier <cabanier@gmail.com>
Cc: www-style list <www-style@w3.org>
On Mon, Sep 29, 2014 at 10:33 AM, Rik Cabanier <cabanier@gmail.com> wrote:
> On Mon, Sep 29, 2014 at 9:40 AM, Tab Atkins Jr. <jackalmage@gmail.com>
> wrote:
>>
>> On Sun, Sep 28, 2014 at 8:41 PM, Rik Cabanier <cabanier@gmail.com> wrote:
>> > All,
>> > I have a couple of question about the current wording of midpoints for
>> > CSS
>> > gradients.
>> >
>> > 1. The spec [1] contains 2 contradictory statements:
>> >
>> > Similarly, the color of a color stop can be omitted. The causes the
>> > color to
>> > be automatically computed to halfway between the two surrounding stops,
>> > so
>> > that the "midpoint" of a transition can be easily adjusted. If multiple
>> > stops in a row lack a color, they space themselves out equally in "color
>> > space", giving more control over the smoothness of the transition.
>> >
>> > and:
>> >
>> > There can only be at most one color interpolation hint between any two
>> > given
>> > normal color stops; using more than that makes the function invalid.
>> >
>> > I think the second statement is the correct one since exponential
>> > interpolation between midpoints is not defined.
>>
>> Yup, I noticed that I still had contradictory stuff around when I was
>> trimming it for Images 3.  I'll fix.
>>
>> > 2. The spec also doesn't require that a midpoint is not the first or
>> > last
>> > stop in a gradient.
>>
>> Yes it does, per the grammar.
>
>
> OK. I was looking at the prose. Maybe you can clarify it there?

Already there: "The first and last color stops in the list must have a
color (though their position can be omitted)."

>> > 3. I think it's OK to assume that a midpoint that coincides with a
>> > regular
>> > stop, does nothing?
>>
>> No, I'm pretty sure it has a (dramatic) effect on interpolation.  Why
>> would it do nothing?
>
> Yes, is that dramatic effect desirable?
> Given 3 colorstops red, green and blue and a midpoint that coincides with
> green, the gradient will be 2 squares red and blue.

The effect is dramatic because it's way over on one side, rather than
close to the middle.  Putting a hint *near* one of the color stops
makes an almost-as-dramatic shift, with it transitioning almost
immediately to the far color.  We don't want to be inconsistent or
expose rounding details.

>> > 4. It is now legal to write a color stop with no information at all.
>> > For instance: linear-gradient(white 0%,,black 100%) -> note the two
>> > commas.
>> > Is this OK?
>>
>> That's not legal.  What part of the grammar makes you think that?
>
> Can you clarify that in the prose?

Where does the prose imply that?

~TJ
Received on Monday, 29 September 2014 17:48:38 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:46 UTC