W3C home > Mailing lists > Public > www-style@w3.org > April 2012

Re: [css4-color] Grayscale shorthand (with alpha)

From: Chris Lilley <chris@w3.org>
Date: Thu, 19 Apr 2012 15:38:49 +0200
Message-ID: <256688551.20120419153849@w3.org>
To: Rik Cabanier <cabanier@gmail.com>
CC: "Tab Atkins Jr." <jackalmage@gmail.com>, Rudolph Gottesheim <r.gottesheim@loot.at>, <www-style@w3.org>
On Wednesday, April 18, 2012, 9:07:46 PM, Rik wrote:

RC> Since sRGB is the colorspace of choice, sGray is probably the
RC> colorspace for grayscale. This makes the conversion
RC> straightforward since xx% Gray will always results in xx% R, xx% G and xx%B

Yes, that is an advantage, if the grey is seen purely as a syntactic shortcut. It becomes less useful if you want warming or cooling tints.

RC> Going the Lab route will result in unexpected results for the
RC> user since 50% L will result in 62% RGB.

I'm not sure where 62% comes from.

To get a mid gray the magic value is 46.6% not 50%; to get a quarter gray its 23.3% not 25%, and a three-quarters gray is 72.3% not 75% (with a D50 reference white and a Bradford CAT).

RC> On Wed, Apr 18, 2012 at 8:44 AM, Chris Lilley <chris@w3.org> wrote:
RC>  On Wednesday, April 18, 2012, 5:05:14 PM, Tab wrote:

 TAJ>> On Wed, Apr 18, 2012 at 5:03 AM, Chris Lilley <chris@w3.org> wrote:
 >>> On Tuesday, April 17, 2012, 11:01:17 AM, Rudolph wrote:
 >>> RG> I find myself writing things like rgba(0, 0, 0, .5) or rgba(192, 192,
 >>> RG> 192, .8) dozens of times a day, mostly for shadows. It's always some
 >>> RG> shade of gray with some alpha value.
 >>> RG> Do you think there's room for a grayscale color shorthand?
 >>> What properties would you want it to have? For example, would 50% gray correspond to a color which is visually 50% between black and white?
 >>> The CIE lightness (L*) has that property. L=0 is black, L=100 is the media white. L=50 is exactly a mid grey.
 >>> It could be used by itself or as part of the CIE Lab or LCH color spaces (C and H are chroma and hue angle) - to give warm or cool greys for example.
TAJ>> I'm definitely interested in investigating the CIELab/LCH color spaces
 TAJ>> at some point,
RC>  What do you want to know about them?
RC>  (Rudolph, note by the way that LCH is not the same as HSV or HSL)
 TAJ>> and we could potentially hook gray() up to that instead
 TAJ>> of RGB.  I wouldn't want to make a choice yet.
RC>  Yes, it really depends on what the requirements are.
RC>  Whatever we decide on has to have a defined colorimetric
RC> interpretation, though (so defining it as L*, or alternatively as
RC> the neutral axis of sRGB, would work; defining it as "your mileage
RC> may vary" device gray would not).

RC>  --
RC>   Chris Lilley   Technical Director, Interaction Domain
RC>   W3C Graphics Activity Lead, Fonts Activity Lead
RC>   Co-Chair, W3C Hypertext CG
RC>   Member, CSS, WebFonts, SVG Working Groups


 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 Thursday, 19 April 2012 13:38:59 UTC

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