- From: Alan Gresley <alan@css-class.com>
- Date: Sat, 30 Jul 2011 10:30:09 +1000
- To: "Tab Atkins Jr." <jackalmage@gmail.com>
- CC: Brian Manthos <brianman@microsoft.com>, Leif Arne Storset <lstorset@opera.com>, Brad Kemper <brad.kemper@gmail.com>, "www-style@w3.org" <www-style@w3.org>
On 30/07/2011 3:59 AM, Tab Atkins Jr. wrote:
> On Fri, Jul 29, 2011 at 5:39 AM, Alan Gresley<alan@css-class.com> wrote:
>> The way Opera interpolates this gradient,
>>
>> linear-gradient(red, transparent, blue)
>>
>>
>> suggest that internally, a double color stop (as shown below) is generated.
>>
>> rgba(255,0,0,0) 50%, rgba(0,0,255,0) 50%
>>
>>
>> So in affect, the keyword 'transparent' is already behaving as a switch.
>
> No. Internally, the colors are interpolated in premultiplied space.
> There is no switch or duplication of color-stops.
>
> ~TJ
Then how is it possible that Opera renders both these gradients the
same? One has one midpoint color stop and the other has two midpoint
color stops.
<!DOCTYPE html>
<style type="text/css">
body {background: #222; padding: 20px; }
div { height: 50px; }
.test1 {
background: white -webkit-linear-gradient(left, red, transparent, blue);
background: white -moz-linear-gradient(left, red, transparent, blue);
background: white -ms-linear-gradient(left, red, transparent, blue);
background: white -o-linear-gradient(left, red, transparent, blue);
}
.test2 {
background: white -webkit-linear-gradient(left, red, rgba(255,0,0,0)
50%, rgba(0,0,255,0) 50%, blue);
background: white -moz-linear-gradient(left, red, rgba(255,0,0,0) 50%,
rgba(0,0,255,0) 50%, blue);
background: white -ms-linear-gradient(left, red, rgba(255,0,0,0) 50%,
rgba(0,0,255,0) 50%, blue);
background: white -o-linear-gradient(left, red, rgba(255,0,0,0) 50%,
rgba(0,0,255,0) 50%, blue);
}
</style>
<div class="test1"></div>
<div class="test2"></div>
--
Alan Gresley
http://css-3d.org/
http://css-class.com/
Received on Saturday, 30 July 2011 00:30:34 UTC