Re: [css4-color] 4 Parameters in RGB() and HSL()

On 26/01/2012 8:16 PM, Christoph Päper wrote:
> Tab Atkins Jr.:
>
>> Your third example - rgb(255, 0, 64, 127) - will always be invalid,
>> though - CSS can't distinguish between<integer>  and<number>  in
>> general, so the fact that alpha already takes a number in [0,1] means
>> we can't also have it take an integer in [0,255],
>
> <alpha>  can only and must be used – unless we allow<percentage>  as an alternative – when the function name ends in an ‘a’, otherwise the transparency value is given as either<percentage>  (always for HSL) or<integer>, iff red, green and blue are also provided as integers in the range [0,255].

> We should have
>
>   +  rgb(<integer>,<integer>,<integer>,<integer>)                  !
>   +  rgb(<percentage>,<percentage>,<percentage>,<percentage>)
>   +  hsl(<angle>,<percentage>,<percentage>,<percentage>)

This break backwards compatibility so they should be invalid.

 >   +  gray(<percentage>)
 >   +  gray(<percentage>,<percentage>)
 >   +  gray(<percentage>,<alpha>)

There needs to be another way for grayscale since this don't seem right.

graya(<value>,<value>)

 >   +  #RGBA
 >   +  #RRGGBBAA

It does remind me of these threads last year (somehow got split into two).

1. http://lists.w3.org/Archives/Public/www-style/2011Aug/thread.html#msg37
2. http://lists.w3.org/Archives/Public/www-style/2011Aug/thread.html#msg40



-- 
Alan Gresley
http://css-3d.org/
http://css-class.com/

Received on Friday, 27 January 2012 12:24:02 UTC