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

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 UTC