W3C home > Mailing lists > Public > www-style@w3.org > February 2011

Re: [CSS3] support for linear-gradients & radial-gradients

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 7 Feb 2011 09:35:51 -0800
Message-ID: <AANLkTikP0NpVY9PMSM_J6gzBsWAUgdD8U7hb4qBU6w_O@mail.gmail.com>
To: Alan Gresley <alan@css-class.com>
Cc: Simon Fraser <smfr@me.com>, Peter Beverloo <peter@lvp-media.com>, Irfan Mir <theirf@gmail.com>, www-style@w3.org, Adrian Low <aidypoos@optusnet.com.au>, Chris Lilley <chris@w3.org>
On Mon, Feb 7, 2011 at 9:07 AM, Alan Gresley <alan@css-class.com> wrote:
> On 6/02/2011 12:03 PM, Tab Atkins Jr. wrote:
>> I'm going to ignore most of your email, because it was unnecessarily
>> hostile and ill-informed.
> Sorry if my email seem hostile. It was not intended to be hostile.

All is forgiven.

>>> You are implying extra meaning to that part of the spec. Again.
>>>  | This keyword can be considered a shorthand for
>>>  | transparent black, rgba(0,0,0,0), which is its computed value.
>>> It states that transparent can be considered a shorthand for transparent
>>> black. It does not say that transparent has a proper definition as being
>>> transparent black. If it is considered a shorthand for rgba(0,0,0,0),
>>> then
>>> it can also be considered a shorthand for all the other colors with full
>>> alpha transparency. That is 16,777,215 colors.
>> I'm not sure how you make this conclusion.
> My conclusion was based on completely misunderstanding what 'transparent'
> was. I understood 'transparent' to represent 'inherit' color from ancestor
> since I believe wrongly that 'transparent' was clear like fully transparent
> glass. Now I understand that rgba(0,0,0,0) is different from
> rgba(255,255,255,0) and the other 10 million color in between.

Well, 'transparent' *is* clear like fully transparent glass.  All the
zero-alpha colors are, because they're all identical.  But once you
have a non-zero alpha, it matters what color you have.  So, the choice
of exactly which transparent color you use as the endpoint is
important, because it effects the path you take through the
colorspace, and thus what colors you see along the gradient.

The shape of the premultiplied colorspace is just slightly different -
it has only a single 'transparent' color, and it just so happens that
when you draw a straight line from an opaque color to this
'transparent' point, the colors you pass through are what you'd get if
you *just* adjusted the alpha component.

> So we have this.
> <http://css-class.com/test/css/colors/gradient-yellow-trans.htm>
> And for the yellow ~ transparent [1] you want the midway point to be
> (255,255,0,0.5) [2] which when composite on a white background is the same
> as the midway point between yellow ~ white. This I tried to emulate with
> tiles [4] for many months where I could have simply used yellow ~
> rgba(255,255,0,0.0).

Exactly, yes.  Transitioning from yellow->transparent in premultiplied
space gives you the #5 rendering automatically, which is why it's
desirable.  It does make it more difficult to get a rendering like #7,
but I'm okay with that.  (To get a rendering like #7 you have to use
multiple stops to manually specify the path through the colorspace.)

Received on Monday, 7 February 2011 17:36:43 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:13:56 UTC