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

Re: [css3-color] #rrggbbaa annotation

From: Brad Kemper <brad.kemper@gmail.com>
Date: Mon, 5 Apr 2010 23:37:27 -0700
Cc: Biju <bijumaillist@gmail.com>, www-style list <www-style@w3.org>
Message-Id: <0200B59D-BB08-4349-B398-36574C44AC3A@gmail.com>
To: Patrick Garies <pgaries@fastmail.us>

On Apr 5, 2010, at 11:09 PM, Patrick Garies wrote:

> Alpha transparency in hexadecimal will likewise become incomprehensible for many authors and readers if added; the formula isn't even the same because you're doing a conversion to 100 instead of 255 so that's another calculation to remember:
> 
> To 255: 15a + b;
> Example: #BC
> 1. 15(11) + 12
> 2. 165 + 12
> 3. 177 Red/Green/Blue
> 
> To 100: (15a + b) / 255;
> Example: #BC
> 1. (15(11) + 12) / 255
> 2. (165 + 12) / 255
> 3. 177 / 255
> 4. 69.4% Opacity

This seems to assume that 0-255 is a natural way for an author to think about color channels, but not about alpha channels. All four channels are pretty much equivalent to me when I start thinking of a particular value in one. I figure the midway point is somewhere 127.5 on one scale, and between 7E and 7F on the other. I never do the math; I either use a color picker or I poke about with lighter or darker values in each channel. Thinking in terms of 0-255 is not much more natural to me than thinking in terms of 0-16.

Received on Tuesday, 6 April 2010 06:38:04 GMT

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