Re: [css3-color] Fractional values for HSL

On 1/4/11 9:16 AM, Rob Crowther wrote:
> The spec doesn't seem to mention: are fractional values allowed in HSL
> notation? For example if I have a color hsl(210,50%,40%) and want one at
> one third of the level can I use hsl(210,50%,13.3%)? Is it actually
> going to be any different to hsl(210,50%,13%)?
>
> Firefox and Opera seem to handle it fine, but I'm not sure if they're
> just rounding things internally or something.

Gecko parses hsl/hsla() into three floats, the converts to rgba space 
and rounds the components to integers.  All colors in Gecko are stored 
internally as a 4-byte sequence; one byte each for r, g, b, and a.

-Boris

Received on Tuesday, 4 January 2011 20:34:11 UTC