RE: [CSS3-color] [css3-images] [css3-transitions] transparent transitions

The full answer is to recommend that authors use rgba(.., .., .., 0) when they want to specify "which transparent" they really want.

No fixed value of the keyword 'transparent' will handle all situations unless all relevant technologies (html, svg, css, etc.) decide to switch to pre-multiplied for interpolation.

I don't recommend changing the transparent keyword mapping since doing so just moves the failure cases ("too dark") to somewhere else ("too light", "too reddish" or "too greenish") rather than fixing the issue, and causes unnecessary churn for all parties (implementers, spec editors, web authors, etc.).

- Brian


> -----Original Message-----
> From: www-style-request@w3.org [mailto:www-style-request@w3.org] On
> Behalf Of L. David Baron
> Sent: Monday, June 27, 2011 10:53 AM
> To: fantasai
> Cc: www-style@w3.org; Tantek Çelik
> Subject: Re: [CSS3-color] [css3-images] [css3-transitions] transparent
> transitions
> 
> On Monday 2011-06-27 13:46 -0400, fantasai wrote:
> > On 01/12/2011 12:26 PM, Tab Atkins Jr. wrote:
> > >
> > >What you're seeing is the fact that transitions from opaque colors to
> > >transparent in non-premultiplied space get darker as they progress.
> > >Try doing a transition from opaque white to transparent over a white
> > >background, and you'll see it very clearly - you'll get an image that
> > >starts white, darkens to gray, and then lightens to white again.
> >
> > Is there a way to avoid things like this? It seems to me that having
> > 'transparent' mean 'transparent black' means you almost never get what
> > you want, which is the opacity fading without the color itself changing.
> > I think that's a common enough use case that it should be easy to do.
> 
> The way to avoid it is to transition in premultiplied space instead.
> (Gecko does this for transitions, but not yet for gradients.)
> 
> -David
> 
> --
> L. David Baron                                 http://dbaron.org/

> Mozilla Corporation                       http://www.mozilla.com/

> 

Received on Monday, 27 June 2011 19:35:05 UTC