W3C home > Mailing lists > Public > www-style@w3.org > February 2012

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

From: Brian Manthos <brianman@microsoft.com>
Date: Tue, 21 Feb 2012 19:09:37 +0000
To: "L. David Baron" <dbaron@dbaron.org>, Rik Cabanier <cabanier@gmail.com>
CC: Tab Atkins Jr. <jackalmage@gmail.com>, www-style list <www-style@w3.org>
Message-ID: <9710FCC2E88860489239BE0308AC5D170EC5B08B@TK5EX14MBXC266.redmond.corp.microsoft.com>
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 GMT

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