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

Re: [css-color-4] Renaming gray()

From: Rik Cabanier <cabanier@gmail.com>
Date: Wed, 23 Jul 2014 11:14:51 -0700
Message-ID: <CAGN7qDChVyWjmu8Z0hVSSzVKTFFiQHuNctpmQS8d5DbD0E55_g@mail.gmail.com>
To: Lea Verou <lea@verou.me>
Cc: www-style list <www-style@w3.org>
On Wed, Jul 23, 2014 at 11:01 AM, Lea Verou <lea@verou.me> wrote:

> The gray() functional notation [1] is a great idea for specifying
> desaturated colors with varying degrees of transparency in a concise and
> readable way. However, I’m not sure about the naming. Right now, the named
> color `gray` corresponds to gray(50%). gray(0%) is black and gray(100%) is
> white.
>
> After using this function myself for a while (through emulating it in
> SASS), I’m starting to think its naming is quite unintuitive. The usual
> assumption with functions that take a 0-100% parameter is that 100% gives
> the full “effect” of the function name, in this case, gray. Ask any random
> person what color they think gray(100%) represents, I doubt they’d guess
> white. I just tried it with a friend and his response verified what I
> thought.
> For example, think of CSS filter functions: sepia(100%) colorizes the
> image as sepia, values < 100% are a lighter version of the effect. Same
> with invert(), grayscale() etc.
>
> If we want to keep the link to hsl(), white() might be a better name.
> Although, I’m not sure if white(0%) == black is exactly intuitive, but it
> seems more intuitive than gray(0%).
> Or, we might reverse the parameter and have black(100%) == black and
> black(0%) == white, which is on par with how many real life things work,
> such as (grayscale) printing.
> Or maybe someone else has a better idea?
>

This is probably a remnant from postscript's 'setgray' function.
I always found it to be very confusing as well so I support renaming 'gray'
to 'black'
Received on Wednesday, 23 July 2014 18:15:19 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:42 UTC