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

Re: Color values to represent floating point colors

From: Kari Pihkala <kari.pihkala@gmail.com>
Date: Sat, 3 Mar 2012 10:58:19 +0200
Message-ID: <CAE0t3My5kvFrk5Y6QHH+ga19+vQ_hUyGq2iW2WFLg+m4F=2xMg@mail.gmail.com>
To: Rik Cabanier <cabanier@gmail.com>
Cc: www-svg@w3.org
Hi Rik,

Yes, I was looking for a way to define colors with more than 256 levels and
percentage values with decimals are the only way to do it. Great that
you'll make that more clear in the next spec.

BR,
Kari


2012/3/3 Rik Cabanier <cabanier@gmail.com>

> Hi Kari,
>
> you found an inconsistency in the spec.
> I'd say that SVG should follow the CSS2 specification. Otherwise, there is
> no way to get more than 256 values for a particular color.
>
> We should fix this in the SVG2.0 spec.
>
> Rik
>
> On Thu, Mar 1, 2012 at 8:43 AM, Kari Pihkala <kari.pihkala@gmail.com>wrote:
>
>> Hi all!
>>
>> I wonder if it is possible to define SVG colors as percentages with
>> decimal values?
>> 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]..."
>>
>> http://www.w3.org/TR/SVG/types.html#DataTypeColor
>>
>> 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* ")"
>> http://www.w3.org/TR/SVG/types.html#DataTypeColor
>>
>> Which one is correct?
>>
>> BR,
>> Kari
>>
>>
>
Received on Saturday, 3 March 2012 08:58:48 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:50 GMT