W3C home > Mailing lists > Public > www-style@w3.org > January 2011

Re: [css3-color] Fractional values for HSL

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Tue, 04 Jan 2011 14:33:06 -0600
Message-ID: <4D238402.2030906@mit.edu>
To: Rob Crowther <robertc@boogdesign.com>
CC: "www-style@w3.org list" <www-style@w3.org>
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

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:13:54 UTC