W3C home > Mailing lists > Public > www-style@w3.org > July 2011

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

From: Alan Gresley <alan@css-class.com>
Date: Fri, 08 Jul 2011 17:48:24 +1000
Message-ID: <4E16B648.9030109@css-class.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
CC: fantasai <fantasai.lists@inkedblade.net>, www-style@w3.org, Tantek Çelik <tantek@cs.stanford.edu>
On 29/06/2011 4:27 AM, Tab Atkins Jr. wrote:
> On Mon, Jun 27, 2011 at 10:46 AM, fantasai
> <fantasai.lists@inkedblade.net>  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.

This is a blanket assertion. Does this gradient get darker as it progresses.

   background: linear-gradient(black, rgba(255,255,255,0.0))

>>> Try doing a transition from opaque white to transparent over a white
>>> background, and you'll see it very clearly

This is true as long as I continue to have the same background-color. 
The below gradient composite on a white background does not get darker.

   background: white linear-gradient(black, rgba(255,255,255,0.0))

So apart from this suggested change affecting transparent-black, any 
gradient with a transition to transparent-white are also broken along 
with transitions to the other 16,777,214 transparent color points apart 
from ones that behaves as a gradients in premultiplied space similar to 
this one.

   linear-gradient(white, rgba(255,255,255,0.0))

>>> - you'll get an image that
>>> starts white, darkens to gray

Actually transparent-gray rgba(127,127,127,0.5).

>>, and then lightens to white again.

It's not white and it _does not lighten_ since it's color is also 
decreasing along with the alpha before it becomes transparent-black 
composite over a white background. What you are saying is white is 
actually the white of the white background-color, not the gradient.

>> 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.
> dbaron's got it - Image Values requires gradients to transition in
> premultiplied space for precisely this reason.

What reason? The supposed reason is based on a problem that never 
existent. Can you clearly state a problem or an issue?

> Premultiplied
> transitions are identical to non-premultiplied when you hold either
> the alpha or the color steady, and they're generally more attractive
> when both the color and alpha change at the same time.
> ~TJ

You wrote,

   | Premultiplied transitions are identical to
   | non-premultiplied when you hold either the alpha
   | or the color steady.

This is incorrect. Are these identical?

   background: white linear-gradient(rgba(255,255,255,0.5), 
   background: white linear-gradient(rgba(255,255,255,0.5), 

Alan Gresley
Received on Friday, 8 July 2011 07:49:01 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:02 UTC