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

Re: [css4-color] #RGBA

From: Alan Gresley <alan@css-class.com>
Date: Tue, 07 Sep 2010 15:16:56 +1000
Message-ID: <4C85CAC8.7080009@css-class.com>
To: Patrick Garies <w3c.www-style@patrick.garies.name>
CC: "Tab Atkins Jr." <jackalmage@gmail.com>, Christoph P├Ąper <christoph.paeper@crissov.de>, "www-style@w3.org" <www-style@w3.org>
Patrick Garies wrote:
>  On 2010-09-06 12:43 PM, Tab Atkins Jr. wrote:
>>  This needs to be cleared up, actually.  It's not at all clear what
>>  the actual requirements are around the first argument.  The prose
>>  just says that the deg unit is "implied".
> 
> After being informed that things are defined in terms of CSS3 Values & 
> Units, this seems more clear. From Section 4.2.4 HSL color values: "This 
> angle is so typically measured in degrees that the unit is implicit in 
> CSS; syntactically, only a <number> is given." Since |<angle>| is its 
> own type, |deg| is apparently excluded.


You write, "This angle is so typically measured in degrees that the 
unit is implicit in CSS."

This is since it based on the absolute of mathematics is sRGB space.


Using #RGB notation and moving 4 steps per channel in sRGB space, we 
have this maths.

24     = 24
18 x 2 = 36
12 x 3 = 36
6 x 4  = 24
1 x 5  = 5

24 + 36 + 36 + 24 + 5 = 125

5 x 5 x 5 = 125


Using #RGB notation and moving 5 steps per channel in sRGB space, we 
have this maths.

30     = 30
24 x 2 = 48
18 x 3 = 54
12 x 4 = 48
6 x 5  = 30
1 x 6  = 6

30 + 48 + 54 + 48 + 30 + 6 = 216

6 x 6 x 6 = 216

This is how many colors appear in this test.


<http://css-class.com/test/css/colors/3d-color-prism-216-colors.htm>


Using #RRGGBB and using the full steps from 0 to 255, the outer ring 
of sRGA space seen in the test above would have 256 colors. The 
possible colors in such sRGB space including black which is the 
absence of and red, green and blue is the sum of 256 cubed, which 
equals 16,777,216.

So the outer ring of 256 colors is where we get our our 255 degrees or 
the amount of steps to return to 0 or steps or different hue around a 
perceived circle which is really tracing steps around a hexagon.



-- 
Alan http://css-class.com/

Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo
Received on Tuesday, 7 September 2010 05:17:31 GMT

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