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

25.01.2012, 18:11, "Christoph Päper" <christoph.paeper@crissov.de>:
> Several pseudo functions accept different numbers of parameters, the rightmost parameters are then optional, original ones don’t change their meaning. In CSS3: Color rgba() and hsla() have been added without taking advantage of this polymorphous capability. They also have been criticized for always denoting the alpha value as a number in the range 0.0–1.0, not as a percentage.
>
> Could we therefore make
>
>   rgb(100%, 80%, 60%, 40%)
>   hsl(300deg, 60%, 40%, 20%)
>   rgb(255, 0, 64, 127)
>
> valid in Level 4?

Indeed, separate rgba() function looks redundant since we could just add fourth parameter to rgb().

Percentage values as allowed alternative for 0.0-1.0 decimal for alpha opacity look nice too. Not sure such notation is appropriate in place of 0-255 numbers, though.

Received on Wednesday, 25 January 2012 14:33:50 UTC