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

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

From: Rik Cabanier <cabanier@gmail.com>
Date: Tue, 21 Feb 2012 11:29:48 -0800
Message-ID: <CAGN7qDDcwRab1FtbHU8Ki3QWa=_azfFJYnEA0un0G6UYPOXegQ@mail.gmail.com>
To: Brian Manthos <brianman@microsoft.com>
Cc: "L. David Baron" <dbaron@dbaron.org>, "Tab Atkins Jr." <jackalmage@gmail.com>, www-style list <www-style@w3.org>
Hi Brian,

that works but it's pretty ugly.
It seems like overkill to force a concept like premultiplied alpha on the
user just to get 'transparent' to do what you expect.

If current behavior was already discussed and now implemented, it's
probably not worth changing at this point.

Rik

On Tue, Feb 21, 2012 at 11:09 AM, Brian Manthos <brianman@microsoft.com>wrote:

> 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:30:16 GMT

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