W3C home > Mailing lists > Public > www-style@w3.org > March 2010

Re: [css3-color] #rrggbbaa annotation

From: Alberto Lepe <dev@alepe.com>
Date: Fri, 26 Mar 2010 10:01:52 +0900
Message-ID: <8c9249b71003251801q47f92ee7kb0418626dedd9b2d@mail.gmail.com>
To: "www-style@w3.org" <www-style@w3.org>
On Fri, Mar 26, 2010 at 12:30 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> On Thu, Mar 25, 2010 at 1:24 AM, Daniel Glazman
> <daniel.glazman@disruptive-innovations.com> wrote:
>> Le 25/03/10 06:01, Zack Weinberg a écrit :
>>>> I think most developers uses the HEX annotation because it is just
>>>> simpler, shorter, cleaner and widely used in graphical applications.
>>> In more detail, please?  My immediate reaction is that, far from
>>> being "simpler" or "cleaner", #rrggbb is already too hard to read on
>>> account of the absence of separators, and tacking an aa component on
>>> the end just makes it worse; so I personally don't think #rrggbbaa
>>> should be added to CSS at all.  (I'll grant you "shorter", but
>>> terseness must give way to readability wherever the two are in
>>> conflict.)
>> Zack, I agree with Alberto. A lot of people use the hex notation for
>> the reasons below:
>> 1. if you're using an color picker or a color chart, it's easier to
>>   manipulate or copy/paste one token rather than three
>> 2. a double-click on an hex token gets everything, you need click-
>>   extend on a rgb() notation
>> 3. a lot of editing tools prefer the hex notation and output colors
>>   in that form; please note Gecko and many CSS OMs output rgb()...
>> 4. I disagree it is hard to understand
> I use #rrggbb for all my colors, everywhere.  It's just easier to type
> and read, and I've gradually picked up an intuition for how it works
> (though I use an hsl color picker when I'm actually choosing colors
> for a site).  Converting to decimal so I can use rgba() has been an
> annoyance every time I've had to do so.  I've always wanted an
> #rrggbbaa notation.
> ~TJ

Thank you TJ, its good to know that I'm not the only one that thinks
it should be added.

One problem I see of not introducing the #rrggbbaa annotation is that
you may end with a mixture of annotations in your styles and it makes
really hard to change or identify similar colors. For example, assume
that I have all over my stylesheets something like:

color: #56726C;
border: 1px #56726C solid;

background-color: rgba(86, 114, 108, 0.5); /* The same color as #56726C */


If I want to do a massive change of color from #56726C to #88936C,
replacing #HEX annotation its very easy, while replacing rgba() it is
more difficult as it may have differences in spaces like
rgba(86,114,108,0.5); and it would be necessary to convert #HEX values
to rgb() values in order to match the same color. If there could be a
#rrggbbaa annotation, the replacement could be done in seconds:

background-color: #56726C80

will become:

background-color: #88936C80

Easy! don't you think?

Otherwise, I should start writing everything in rgb() and rgba()
annotation and forgot completely about #rrggbb annotations which I
have been using for the last 10 years.
Received on Friday, 26 March 2010 01:02:26 UTC

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