W3C home > Mailing lists > Public > www-style@w3.org > August 2010

RE: CSS3 Color: Interaction of opacity and rgba [css3-color]

From: Bonner, Matt <matt.bonner@hp.com>
Date: Mon, 23 Aug 2010 17:40:47 +0000
To: Chris Lilley <chris@w3.org>
CC: "L. David Baron" <dbaron@dbaron.org>, "www-style (www-style@w3.org)" <www-style@w3.org>
Message-ID: <57221E38FB4DD54C946CE654959A554D54EA58470C@GVW0436EXB.americas.hpqcorp.net>
Makes sense, thanks Chris.

Matt Bonner
Hewlett-Packard Company

-----Original Message-----
From: Chris Lilley [mailto:chris@w3.org] 
Sent: Monday, August 23, 2010 9:48 AM
To: Bonner, Matt
Cc: L. David Baron; www-style (www-style@w3.org); Refstrup, Jacob Grundtvig
Subject: Re: CSS3 Color: Interaction of opacity and rgba [css3-color]

(This reply is long overdue, sorry)

On Thursday, June 5, 2008, 6:42:21 PM, Matt wrote:

BMI> David Baron wrote:

>> I don't think any change to the specification is needed.  It
>> describes the two features independently, since they are in fact
>> independent.

BMI> The two features could be considered independent, but they interact,
BMI> right?  That is, some compositing operation determines how to apply
BMI> the opacity to an RGBA color, and then how to apply the result to
BMI> the rendering so far.

You are correct, they do interact and this should be described. Both opacity and rgba() use alpha compositing in sRGB space according to the 'source-over' operator in the Porter-Duff model. This has already been standardised as part of SVG 1.1, which is a W3C Recommendation, so the editors draft of CSS3 color references the 'simple alpha compositing' part of that specification.


BMI> More generally, it seems like clarifying what exactly the opacity 
BMI> property does might help. Currently, the spec says:

>> Opacity can be thought of conceptually as a postprocessing operation.
>> Conceptually, after the element (including its children) is rendered
>> into an RGBA offscreen image, the opacity setting specifies how to
>> blend the offscreen rendering into the current composite rendering.

BMI> Which doesn't seem quite right. The opacity doesn't say *how* to blend
BMI> an element into the existing rendering, a "compositing" property would
BMI> say how to do that [1]. 

Again, correct. The only compositing operation allowed in CSS3 color is the src-over operator.

BMI> The opacity property only specifies the fraction
BMI> of light penetration blocked by this element, right?


BMI> It seems like getting all browsers to look the same might also require
BMI> specifying the blending operation.  Perhaps that is specified in the
BMI> spec, but I didn't see it near the descriptions of opacity, rgba or
BMI> alphavalue.

The equation for the blending operation is now specified in the editors draft of CSS3 color, and uses src-over in sRGB space as does SVG.

Thanks for your review, which has resulted in a useful clarification of the specification.

 Chris Lilley   Technical Director, Interaction Domain                 
 W3C Graphics Activity Lead, Fonts Activity Lead
 Co-Chair, W3C Hypertext CG
 Member, CSS, WebFonts, SVG Working Groups
Received on Monday, 23 August 2010 17:43:06 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:49 UTC