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

Re: [css3-color] #rrggbbaa annotation

From: Alberto Lepe <dev@alepe.com>
Date: Thu, 25 Mar 2010 21:42:59 +0900
Message-ID: <8c9249b71003250542u1d3a3fb0w116bddd5556d00c3@mail.gmail.com>
To: "www-style@w3.org" <www-style@w3.org>
On Thu, Mar 25, 2010 at 6:26 PM, David Chambers
<david.chambers.05@gmail.com> wrote:
> On 25 March 2010 20:13, Patrick Garies wrote:
>
>> I have a feeling that your average author would assume that "AA" is
>> decimal rather than hexadecimal and, thus, that 55 indicates 55% opacity
>> (unlike with color, I've never seen any program represent opacity as
>> anything other than a decimal number or percentage).
>
> This is an excellent point. Opacity is generally specified in percentage
> terms by design applications, and CSS uses values between 0 and 1 for the
> opacity property. Conversion between these two units is trivial, and there's
> very little room for confusion (only a tiny range of percentage values fall
> between 0 and 1).
>
> The fact that, as Patrick points out, there are "AA" values in #RRGGBBAA
> which look like percentages is confusing in my book.
>
> David
>

Thank you for your responses (and excuse my English as it is not my
native language). Additionally to the reasons presented by Daniel
Glazman, these are the some reasons of why I would like to see this
feature included (in not a specific order):

1) I think we already agree its shorter and cleaner:

color: rgba( 255, 255, 255, 0.3)
color: hsla(100%, 100%, 100%, 0.3)
color: #FFF5
color: #FFFFFF4C

2) I work a lot with Inkscape to build the initial designs and it uses
#RRGGBBAA annotation, which FF translates to 255 in the RGB color
picker. So, in order to replicate the same combination of colors and
transparencies, I have to convert 255 to 0-1 scale (which is not
complicated but less faster than just a copy+paste).

3) Sometimes I don't care too much about small differences in
transparency, so in general terms a .33% will do almost the same job
as a .3%. If I know that #80 its almost 50% I can get easily an idea
of how much transparent I want it to be. This may not be the way
people would normally do it... you can use a simple calculator or let
some software to do that job for you.

4) All my stylesheets are expressed in #HEX annotation. In order to
add simple transparency (lets say ~50%) , I would need to convert each
rule in rgba annotation, instead of just adding #80 at the end.

5) Just for matter of congruency, if we have already:
rgb() and rgba()
hsl() and hsla()
#rgb  (where is #rgba ??)

As Daniel agreed, it is not complicated. I remember when I started
developing webpages 10 years ago. I didn't understand very good how
the #HEX annotation worked, but I learned it and I like it. For me its
a lot more faster to write #CCC (which I know perfectly witch color
is) than something like rgb(0, 0, 204). I don't think it is confusing
to add the extra #AA as the people that will use it will have to learn
what exactly means,  as we learned that #999 was not rgb(99,99,99) .
Any person unfamiliar with #HEX annotation may will prefer to use
rgb() annotation.

There are some situations in which rgba annotation is better, but for
some other situations (which I'm trying to explain), #HEX annotation
could be better (IMHO). One important point here is that it would be
the only annotation in which transparency is expressed 0-255,
increasing the compatibility with several graphic software.

I think I'm not the only person in the world that would like to see
this implementation. Let it as an additional alternative to express
colors with transparency, and let the people to choose the one that
please them more. That is what all is about, isn't it? if not, then
why hsla() annotation exits?

Finally, to Patrick:

> If this feature would be "useless" in the future, then there's no reason
> to implement it /now/.

If we can't add this feature to CSS3, because it is too late (assuming
its a good idea), then waiting until CSS4 to add it makes no sense to
me. I'm assuming that CSS4 will be released in at least 5 years (the
draft), in which all the developers and web-builder software will be
already using the rgba and hsla annotation, doing #RGBA annotation
unattractive (because it will not provide any new real feature, which
is the use of transparency).

Please forgive me if I look like a stubborn person. I'm not. I just
think this could be really helpful for many people.
Received on Thursday, 25 March 2010 12:43:33 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:25 GMT