Re: [css4-color] #RGBA

On Mon, Sep 6, 2010 at 10:28 AM, Patrick Garies
<w3c.www-style@patrick.garies.name> wrote:
> On 2010-09-05 5:23 PM, Christoph Päper wrote:
>>
>> Brian Manthos:
>>>
>>> Does HSL/HSLA get a short syntax as well?
>>
>> It already has a short syntax: instead of
>>
>> hsla(180deg, 0%, 50%, 100%)
>>
>> you write
>>
>> hsla(180, 0, 0.5, 1).
>>
>> It lacks the long version.
>
> This isn't correct. While the |deg| unit identifier is not required (and
> apparently forbidden), your syntax has the following errors:

This needs to be cleared up, actually.  It's not at all clear what the
actual requirements are around the first argument.  The prose just
says that the deg unit is "implied".


> 1. The saturation and lightness arguments are percentages on a range from
> 1-100, not 0-1.
> 2. Unlike other CSS values, the percentage (|%|) unit identifier is required
> even for values of zero.
>
> (I don't know where the spec says those things though; for some reason, CSS3
> Color seems to be lacking as far as syntax productions.)

In CSS3 Values & Units, the <length> type says that its unit can be
omitted if the value is 0.  No other type says this, so no other type
gets to omit its unit.

~TJ

Received on Monday, 6 September 2010 17:44:27 UTC