W3C home > Mailing lists > Public > www-svg@w3.org > March 2012

Color values to represent floating point colors

From: Kari Pihkala <kari.pihkala@gmail.com>
Date: Thu, 1 Mar 2012 18:43:38 +0200
Message-ID: <CAE0t3MwU30dfPZAi=v-rYRoAW3H0=jXGwjybK__Sj=2pzeToJw@mail.gmail.com>
To: www-svg@w3.org
Hi all!

I wonder if it is possible to define SVG colors as percentages with decimal
Something like this: <rect fill="rgb(100%, 50.002%, 1.9607%)" ... />

The specifications are not clear about this (or I'm reading them wrong..).

SVG spec says: "SVG supports all of the syntax alternatives for <color>
defined in CSS2 syntax and basic data types ([CSS2].."

The referred part of the CSS2 specification (
http://www.w3.org/TR/2008/REC-CSS2-20080411/syndata.html#value-def-color )
says that "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 ')'"
Since percentage values accept decimal values, the CSS spec says that
decimal values are ok.

However, few paragraphs later, the SVG 1.1 spec defines the percentage
values as integers, which seems to go against the CSS spec: "rgb(" wsp*
integer "%" comma integer "%" comma integer "%" wsp* ")"

Which one is correct?

Received on Friday, 2 March 2012 22:13:31 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:29:50 UTC