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

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 1 Dec 2011 10:33:18 -0800
Message-ID: <CAAWBYDCO1A2pf_5zDW+r=oiLymXRhTT5gUgzAAQbmtMpGiqzXw@mail.gmail.com>
To: Chris Nager <cnager@gmail.com>
Cc: www-style@w3.org
On Tue, Nov 29, 2011 at 9:34 AM, Chris Nager <cnager@gmail.com> wrote:
> Hey Markus,
> I completely agree. I sent a tweet out about this a while back:
> https://twitter.com/#!/ChrisNager/status/83651049558253568
> @ChrisNager:
> "As far as color hexcodes go in #css, I've always thought if #0cf works for
> #00ccff, shouldn't #f work for #ffffff and #a1 work for #a1a1a1?"

As I argued in the thread that you are responding to (starting at
there's not much benefit to allowing these.

The 2-digit hex syntax saves 1 or 4 characters (depending on whether
the two digits are the same), and since the saved characters are just
repetition, it's worth even less than that.  The 1-digit hex syntax
saves 2 character, and again the savings are pure repetition.  This is
an extremely minimal benefit.

Neither of these play well with the plans to add alpha to the 3- and
6-digit hex syntaxes.

I argued in the thread that there may be sufficient value in adding a
gray() function which accepts a number or percentage, like rgb(),
because the characters savings is greater there.  As well, it can
handle alpha better, as a second parameter.

Received on Thursday, 1 December 2011 18:34:09 UTC

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