W3C home > Mailing lists > Public > www-style@w3.org > June 2012

Re: [css4-color] Make the r/g/b components be <number> rather than <integer>?

From: Simon Sapin <simon.sapin@kozea.fr>
Date: Sat, 09 Jun 2012 00:42:28 +0200
Message-ID: <4FD27FD4.50909@kozea.fr>
To: www-style@w3.org
Le 08/06/2012 22:20, Tab Atkins Jr. a écrit :
> Could we make the rgb components of rgb/a() be <number> rather than
> <integer> in level 4?

I’m in favor; I don’t see a downside in allowing it.

> I suggest we cast the components to integers in the same way we did
> for Transitions - normal round, .5 goes toward positive infinity.

I’m not sure what rounding this is. I understand that as "n + 0.5 is 
rounded to n + 1" (with n an integer). What about n + 0.1 ? In the 
current Transitions ED I read "The interpolation happens in real number 
space and is converted to an integer using floor().", I think so n+0.5 
would be rounded to n, not n+1

In any case, the spec should define how to round (in what direction), 
but maybe not at which resolution. If an implementation can support more 
than 8bits per color channel the spec’ed rounding should not limit that.

Simon Sapin
Received on Friday, 8 June 2012 22:42:59 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:00 UTC