- From: Rik Cabanier <cabanier@gmail.com>
- Date: Tue, 21 Feb 2012 11:12:05 -0800
- To: "L. David Baron" <dbaron@dbaron.org>
- Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, www-style list <www-style@w3.org>
- Message-ID: <CAGN7qDBrZgaHAuJKe4AxFEZpnRX_NyYYBxyoRrHT8qzm4Qk29w@mail.gmail.com>
On Tue, Feb 21, 2012 at 10:53 AM, L. David Baron <dbaron@dbaron.org> wrote: > On Tuesday 2012-02-21 10:40 -0800, Rik Cabanier wrote: > > specifying premultiplied alpha to fix the issue seems odd. > > It seems that the issue is really how to you handle the 'transparent' > > keyword. Because transparent is specified as (0,0,0,0) you transition the > > color values as well. > > So, non-premultiplied red->transparent, the midpoint of your gradient > > becomes (0, .5, 0, .5) which after compositing with white becomes (.5, > .75, > > .5) which is too dark. > > In premultiplied space, you end up with (.5, 1, .5) which is what you > want. > > > > 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. > > > > Was this discussed and deemed OK? I tried to find it in the archives but > > couldn't find it. > > Sorry if this was already decided. > > I believe it has been discussed a number of times. > > There are effects that one can achieve with either premultiplied > alpha or nonpremultiplied alpha that cannot be achieved with the > other. Choosing premultiplied means optimizing for the normal case > rather than the odd feature of transition to transparent + color. > > Well, you *could* special case 'transparent' to say use a transparent version of the previous or next color stop which is really what the author means. I don't think going from red to transparent yellow is an odd case at all. It gives you a similar effect to InDesign's gradient feather. Rik
Received on Tuesday, 21 February 2012 19:12:39 UTC