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

[css3-images] Premultiplication switch (was: gradient pre-multiplied interpolation)

From: Leif Arne Storset <lstorset@opera.com>
Date: Wed, 27 Jul 2011 14:37:13 +0200
To: "www-style@w3.org" <www-style@w3.org>
Message-ID: <op.vy92ob11tmo5g6@localhost.localdomain>
Alan Gresley <alan@css-class.com> skreiv Wed, 27 Jul 2011 12:52:34 +0200

> Regarding the recent CSS minutes and interpolation of gradients.

[snip]

>> 00:00:45 [fantasai]
>>     RESOLVED: Use premultiplied colors for gradients and transitions
>
> One way around the issue is that when keywords are used, the gradient  
> uses pre-multiplied space. If rgba() or hsla() are used, the gradient  
> uses un-premultiplied space. The same can happen with transitions for  
> color to color.

I agree with Alan that the effects demonstrated at [0] are desirable, but
premultiplied is a much better default. The switching idea is worth
considering, however. I think use of the rgba() and hsla() are potentially
confusing as switches, but an explicit 'unpremultiplied' switch wouldn't
be: 'linear-gradient(left, unpremultiplied, rgba(255,255,0,0), yellow)'.

It's worth noting that one can still use SVG for unpremultiplied
gradients, so it's not impossible to achieve in any case. How easy we make
it depends on how important we judge this use-case to be. In my view this
is relatively rare (examples of use on the real Web would be welcome!) but
it has a number of outspoken defenders and is cheap to support (given that
all implementations support unpremultiplied from before and all will
support premultiplied within a year). And I must say, many of the examples
at [0] look very nice.

I lean towards supporting this case using a switch.

0. http://css-class.com/test/temp/color-transparent.htm

-- 
Leif Arne Storset
Core Technology Developer, Opera Software
Oslo, Norway
Received on Wednesday, 27 July 2011 12:37:44 GMT

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