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

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

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

Rik

On Wed, Apr 18, 2012 at 8:44 AM, Chris Lilley <chris@w3.org> wrote:

> 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,
>
> What do you want to know about them?
>
> (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.
>
> Yes, it really depends on what the requirements are.
>
> Whatever we decide on has to have a defined colorimetric interpretation,
> though (so defining it as L*, or alternatively as the neutral axis of sRGB,
> would work; defining it as "your mileage may vary" device gray would not).
>
> --
>  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 Wednesday, 18 April 2012 19:08:16 UTC