W3C home > Mailing lists > Public > www-style@w3.org > April 2009

Re: Exact syntax for <color> values

From: Giovanni Campagna <scampa.giovanni@gmail.com>
Date: Mon, 13 Apr 2009 11:12:20 +0200
Message-ID: <65307430904130212j54350ac3n5f263a2eb0ac8487@mail.gmail.com>
To: www-style@w3.org
2009/4/13 Cameron McCormack <cam@mcc.id.au>:
> I’m trying to work out the exact syntax that RGB <color> values have,
> according to CSS 2.1.  http://www.w3.org/TR/CSS21/syndata.html says:
>
>  The format of an RGB value in the functional notation is "rgb("
>  followed by a comma-separated list of three numerical values (either
>  three integer values or three percentage values) followed by ")". The
>  integer value 255 corresponds to 100%, and to F or FF in the
>  hexadecimal notation: rgb(255,255,255) = rgb(100%,100%,100%) = #FFF.
>  Whitespace characters are allowed around the numerical values.
>
> A couple of specific questions:
>
>  * Are the integers within the parentheses <integer>s or something
>    else?

They're <integer>s (at least, this is my assumption). Section 4.3.1
has some clarifications about "integers" and "<integer>s"

>  * Are the percentages within the parentheses ‘<integer> "%"’,
>    ‘<number> "%"’ or something else?

<percentage> is defined in
<http://www.w3.org/TR/CSS21/syndata.html#value-def-percentage> as
<number> '%'

> Thanks,
>
> Cameron
>
> --
> Cameron McCormack ≝ http://mcc.id.au/
>
>

Giovanni
Received on Monday, 13 April 2009 09:12:59 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 22 May 2012 03:46:58 GMT