Precise syntax of CSS3 colors -


i couldn't find precise definition of legal syntax css3 colors, either regular expression, bnf or whatever strict formal definition there might be. info can derived verbal description in css3 color module (for example comma separated lists may contain whitespace), don't see whether e.g. leading zeros in like

rgb(010,005,255) rgba(050%,1%,01%,0) 

are legal, or omitting leading zeros of decimal fractions, like

rgba(100,100,100,.5) 

i'm not talking tolerated browsers, i'm asking whether officially legal css3 syntax i'm interested in use of these color definitions in non-browser applications well.

as found already, css3 color module specification says

the format of rgb value in functional notation 'rgb(' followed comma-separated list of 3 numerical values (either 3 integer values or 3 percentage values) followed ')'

but need in basic data types section of css 2.1 find out integer or percentage value , says...

some value types may have integer values (denoted ) or real number values (denoted ). real numbers , integers specified in decimal notation only. consists of 1 or more digits "0" "9". can either , or can 0 or more digits followed dot (.) followed 1 or more digits. both integers , real numbers may preceded "-" or "+" indicate sign. -0 equivalent 0 , not negative number.

so integers , numbers can have leading zeros.

then later on basic data types says

the format of percentage value (denoted in specification) followed '%'.

so percentages can have leading zeros too.


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -