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

Re: [css3-color] #rrggbbaa annotation

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Sat, 15 May 2010 00:54:57 -0400
Message-ID: <4BEE2921.8070401@mit.edu>
To: Alan Gresley <alan@css-class.com>
CC: "Tab Atkins Jr." <jackalmage@gmail.com>, Simon Fraser <smfr@me.com>, www-style list <www-style@w3.org>
On 5/15/10 12:37 AM, Alan Gresley wrote:
> 0x00 maps to 0
> 0x80 maps to 0.5
> 0xFF maps to 1.0

I would think that Tab's issue was that while 1.0 - 0.5 == 0.5 - 0, 0xFF 
- 0x80 != 0x80 - 0x00.

So the real question is why 0x80 wouldn't map to 0.50196078431372548 if 
we're going from hex to float.

Or put another way, if we have a set of 256 (really, any even number 
will do) discrete values, there is no way to place them on the closed 
unit interval in such a way that the spacing between two adjacent values 
is a constant and one of the values lands on 0.5.

-Boris
Received on Saturday, 15 May 2010 05:32:04 GMT

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