Re: [css3-images] Gradients feedback

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 UTC