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

Re: [css3-images] Gradients feedback

From: Alan Gresley <alan@css-class.com>
Date: Mon, 06 Sep 2010 22:37:47 +1000
Message-ID: <4C84E09B.8080002@css-class.com>
To: Boris Zbarsky <bzbarsky@MIT.EDU>
CC: www-style list <www-style@w3.org>
Boris Zbarsky wrote:
> On 8/30/10 9:54 AM, Alan Gresley wrote:
>> In other words, the midway point of this gradient,
>>
>> <div style="background:-moz-linear-gradient(left, yellow,
>> transparent)"></div>
>>
>> is the same as this opaque color.
>>
>> <div style="background:#808000;opacity:0.5;"></div>
> 
> If the interpolation is performed in non-premultiplied space, yes.  In 
> premultiplied space, as I said, it's "background: #ffff00; opacity: 
> 0.5".  Which is what the discussion is about.
> 
>> I believe Boris is correct in the mathematics.
> 
> Thanks, I try!
> 
> -Boris


I highly object to this. Gradient interpolation must be performed in 
non-premultiplied space. Some major reason are:

1. Gradients are not another vector in sRGB space (not sure how matrix 
works).

2. This affects all colors in sRGB space that become have a gradient 
to transparent. There is precise maths.


If premultiplied space gradients are allowed, this must be by an added 
keyword. This is because a bell shape arc must be trace along a vector.

Authors should be able to choose between either non-premultiplied and 
premultiplied gradients.

Also the following test would look very wrong in Gecko (especially 
example b) if the gradient was premultiplied.


<http://css-class.com/test/css/shadows/box-shadow-spheres2.htm>



-- 
Alan http://css-class.com/

Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo
Received on Monday, 6 September 2010 12:38:21 GMT

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