RE: [CSS3-images] premultiplied alpha (was rotate(<angle>[, <translation-value>, <translation-value>]))

Rik Cabanier:
> However by forcing premultiplied space, you can no longer go from 'yellow'
> to 'transparent red' because the 'red' value is removed when you multiply
> by 0.

Note that you can approximate the desired effect using a 3rd stop.

linear-gradient(yellow, rgba(255,0,0,0.1) 90%, transparent)

I expect most browsers will not treat "0.1" as "near zero, treat as zero", as such this should work reliably.


If you want a better approximation, you'll need to use tighter numbers which might compromise reliability across implementations because "close enough to zero to treat as zero" is not officially defined:

linear-gradient(yellow, rgba(255,0,0,0.001) 99.9%, transparent)

Received on Tuesday, 21 February 2012 19:10:18 UTC