Re: Color values to represent floating point colors

On Saturday, March 3, 2012, 2:34:00 PM, Dr. wrote:

DOH> This simply looks like a bug, introduced somehow in the second edition
DOH> of SVG 1.1.

Yes, the first edition did not have this bug. And SVG has always supported float percentages for color specification.

DOH> I think, in the first edition, such a problem does not occur:
DOH> http://www.w3.org/TR/2003/REC-SVG11-20030114/types.html#DataTypeColor

DOH> For example SVG tiny 1.2 explictly notes 
DOH> 'an arbitrary number of decimal places may be supplied'.
DOH> http://www.w3.org/TR/SVGMobile12/painting.html#colorSyntax

Right.

This is the correct formal syntax (number rather than integer for the % form):

color    ::= "#" hexdigit hexdigit hexdigit (hexdigit hexdigit hexdigit)?
             | "rgb(" wsp* integer comma integer comma integer wsp* ")"
             | "rgb(" wsp* number "%" comma number "%" comma number "%" wsp* ")"
             | color-keyword
hexdigit ::= [0-9A-Fa-f]
comma    ::= wsp* "," wsp*

where number links to
http://www.w3.org/TR/SVG/types.html#DataTypeNumber



-- 
 Chris Lilley   Technical Director, Interaction Domain                 
 W3C Graphics Activity Lead, Fonts Activity Lead
 Co-Chair, W3C Hypertext CG
 Member, CSS, WebFonts, SVG Working Groups

Received on Monday, 5 March 2012 16:09:21 UTC