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: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 8 Jun 2012 15:50:19 -0700
Message-ID: <CAAWBYDBj6OWstu9GP3rFfZz1hKjbQfPgK_DJP8er0d1BvN4ASQ@mail.gmail.com>
To: Simon Sapin <simon.sapin@kozea.fr>
Cc: www-style@w3.org
On Fri, Jun 8, 2012 at 3:42 PM, Simon Sapin <simon.sapin@kozea.fr> wrote:
> Le 08/06/2012 22:20, Tab Atkins Jr. a écrit :
>> 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 ?

I don't understand what part of my statement was unclear.  ^_^  Do a
normal round operation.  If the decimal portion is .5, round toward
positive infinity, so 1.5 becomes 2 and -1.5 becomes -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

The edit that we resolved on during the last f2f hasn't yet been
applied, I guess.


> 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.

Sure, that's a good point.

~TJ
Received on Friday, 8 June 2012 22:51:08 GMT

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