W3C home > Mailing lists > Public > www-style@w3.org > September 2011

Re: [css] Proposal: making Shorthand Hex Colors even shorter (16 grayscale shades)

From: Philippe Wittenbergh <ph.wittenbergh@l-c-n.com>
Date: Wed, 7 Sep 2011 11:34:23 +0900
Cc: Marat Tanalin <mtanalin@yandex.ru>
Message-Id: <5F6C3B8C-731B-4D19-9BE4-13D239C917FA@l-c-n.com>
To: www-style list <www-style@w3.org>

On Sep 7, 2011, at 4:26 AM, Marat Tanalin wrote:

> 1. As for gray() function.
> I don't want gray() function, I want to shorten hex values. %) The thread author obviously wants the same. You do not want gray() function, others including topic author dont't want this too. So there is no sense to discuss something that is not of our interest at all (with same success we could discuss, say, weather or hadron collider).

It may not be in _your_ interest, but personally I'm much more interested in having a gray() function than extending the hexadecimal notation. I suspect Tab is more interested in the the gray() function as well. But I don't live in his head to know…

When discussing new proposals, the CSS WG should examine all options. imho.

> 2. As for alpha opacity.
> The only reason why RGB components can be represented as hex is that each RGB component has exactly 256 possible values _by nature_. But this has NOTHING TO DO with opacity. Opacity is always specified as decimal number: for example in "opacity" CSS-property, opacity in "rgba()" CSS-function, or percentage transparency in Photoshop. So, hex representation is not only nonapplicable to opacity values, but just inconsistent with existing opacity values notation. Therefore, opacity should be kept specified as a decimal number and is not a subject to shorten at all.

There are precedents for hexadecimal notation including opacity.

Here is a code snippet from one of my stylesheets:
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#801e5799', endColorstr='#7db9e8',GradientType=0 ); /* IE6-9 */

note the startColorstr value, equivalent to rgba(30,87,153,0.5)

That is implemented by Microsoft. Inkscape also uses that notation, fwiw.

(not arguing if it is good or bad to have such a notation in CSS - personally, I strikes me as very hard to read, but that is just me; I'm satisfied with rgba() and hsla()).

Philippe Wittenbergh
Received on Wednesday, 7 September 2011 02:34:48 UTC

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