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: Sat, 5 Feb 2011 17:03:02 -0800
Message-ID: <AANLkTikzhwKJmnFk5F6q1MhbHVrtyncbA+DJOafeqvtg@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>
I'm going to ignore most of your email, because it was unnecessarily
hostile and ill-informed.

On Sat, Feb 5, 2011 at 2:39 AM, Alan Gresley <alan@css-class.com> wrote:
> On 14/01/2011 5:05 AM, Tab Atkins Jr. wrote:
>> CSS2.1 didn't have any notation for non-opaque colors, and so the
>> editors apparently thought that it was easier to refer to
>> 'transparent' specially.  This turned out to be a mistake,
> How is this a mistake?

There were several places in 2.1 where we forgot to add 'transparent'
as an option to a property that accepted colors.  They were all
unintentional mistakes, because 'transparent' was supposed to just be
an ordinary color.

>> and luckily
>> CSS3 Color has a proper way to refer to non-opaque colors, so we can
>> give 'transparent' a proper definition, which we did - it's
>> rgba(0,0,0,0).
> 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.  The computed value of
'transparent' is 'rgba(0,0,0,0)'.  It says so right in the section you
have quoted.  I'm not going to argue non-existent semantic details
with you, because there is no point.  'transparent' means
'rgba(0,0,0,0)', in precisely the same way that 'red' means
'rgb(255,0,0)'.  That's that.

> Ok, I now understanding where you coming from. You see premultiplied space
> or un-premultiplied space as some form of space. I am talking about 3D
> colorspace where you are talking about abstract mathematical concept of
> colorspace.

There's nothing particularly abstract about what I'm saying.  The
rgba() colorspace is a 4d vector space.  So is the premultiplied rgba
colorspace, though it has a slightly different shape.  The two have
almost exactly the same range of colors, though - the only
"difference" is that in premultiplied space there is only one fully
transparent color, expressed as (0,0,0,0), while in non-premultiplied
space there are an infinity of fully transparent colors (or, if you
limit the color components to integers in the range 0-255, there are
256^3 fully transparent colors).

> A gradient from blue to transparent over a white background get lighter
> along it path. I talking about lighter as in HSL. See line 7 with Blue ~
> Transparent.
> <http://css-class.com/test/css/colors/grayscale2.png>
> So your expertise in maths does not reflect an observable reality.

Once again you are confusing yourself by measuring the final composed
color of pixels.

On such a gradient, the blue color is darker.  It is then composed
over white, producing a different color which does indeed gradually
get lighter as the gradient progresses.

Stop trying to reason about the final composed color.  It doesn't
help, and it has served only to confuse you over and over again.

>> The former is clearly darker than the latter, for the same reason
>> rgb(0,0,127) is clearly darker than rgb(0,0,255).
> You can not use this analogy since non-premultiplied rgba space is curved
> and premultiplied rgba space is linear when going from color to transparent
> in sRGB colorspace. The darkness or lightness observed is determined by the
> HSL(A) values of a background color behind what is partially transparent.

No, premultiplied space is not "curved".  When you are working in
premultiplied space, it works just like any other vector space: the
shortest path between two points is a straight line, etc.

When you cast the colors back to non-premultiplied space, the path may
indeed look curved.  That doesn't matter.  Non-premultiplied space
isn't "more real" or anything like that.  It's merely an alternate way
to look at colors.  If you transition between blue and transparent in
non-premultiplied space and then cast the colors back into
premultiplied space, the path looks curved there as well.

> Not allowing the current behavior will break the affects seen here.
> <http://www.marcofolio.net/webdesign/pure_css3_bokeh_effect_with_some_jquery_help.html>

No it won't, at all.  The effect used in that article will be *exactly
identical*.  For example, a transition from rgba(240, 60, 60, 0.1) to
rgba(240, 60, 60, 0.4) is precisely the same in both premultiplied and
non-premultiplied colorspace.

> And break what is seen here with the various colored backgrounds.
> http://css-class.com/test/css/colors/gradient-white-trans2.htm

No it won't.  It will slightly change the effects on that page, but
certainly not "break" them.
Received on Sunday, 6 February 2011 01:03:56 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:55 UTC