W3C

SVG Color 1.2, Part 2: Language

W3C Working Draft

This version:
Latest version:
Editors:
Chris Lilley, W3C <chris@w3.org>
Anthony Grasso, Canon Information Systems Research Australia, <anthony.grasso@research.canon.com.au>
Authors:
The authors of this specification are the participants of the W3C SVG Working Group.

Abstract

This Working Draft defines features of the Scalable Vector Graphics (SVG) Language that are specifically for color-managed environments.

Status of This Document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.

This document is an editors draft. It defines features of SVG specific to color management. It is a draft in progress; some descriptions in this document may be incomplete. This document shows the current thoughts of the SVG Working Group on the use of SVG for color managed environments and should not yet be considered stable. There is an accompanying SVG Color 1.2, Part 1: Primer that lists the ways SVG Color, along with other SVG documents, may be used.

This document has been produced by the W3C SVG Working Group as part of the W3C Graphics Activity within the Interaction Domain. The Working Group expects to advance this Working Draft to Recommendation Status.

We explicitly invite comments on this specification. Please send them to www-svg@w3.org (archives). Acceptance of the archiving policy is requested automatically upon first post to either list. To subscribe to this list send an email to www-svg-request@w3.org with the word subscribe in the subject line.

Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.


How to read this document and give feedback

This draft of SVG Color is a snapshot of a work-in-progress.

The main purpose of this document is to encourage public feedback. The best way to give feedback is by sending an email to www-svg@w3.org (archive) . Please identify in the subject line of your message the part of the specification to which your comment refers. If you have comments on multiple areas of this document, then it is preferable to send several separate comments.

The public are welcome to comment on any aspect in this document, but there are a few areas in which the SVG Working Group are explicitly requesting feedback. These areas are noted in place within this document.

Table of Contents

Introduction

This document lists features that may be used with SVG in color-managed environments, including document interchange, publishing, and high-quality display. SVG Color extends the control of color, relative to SVG 1.1, in three ways. Firstly, the use of ICC color definitions and the respect of color managed embedded images ( both optional in SVG 1.1)are given explicit conformance criteria for user agents and for content. Secondly, by adding additional color spaces for interpolation and compositing; this means that colors are no longer constrained to the sRGB gamut during processing. Thirdly by extending the syntax for Paint, thus allowing colors to be specified as hsl/hsla/rgba values (from CSS3 Color), calibrated (ICC and named) and uncalibrated ('device') color.

Conformance

This document contains explicit conformance criteria that may overlap with the EBNF or RNG definitions. If there is any conflict between these, the explicit conformance criteria in the prose of this specification are the definitive reference.

This document contains conformance criteria for two classes of product:

User Agents

SVG color is an addition to a base profile of the SVG language. A user agent therefore conforms to at least one base profile (e.g. SVG 1.1 or SVG Tiny 1.2 ) and also to this specification.

A Color-managed User Agent MUST support both ICC v.2 and ICC v.4 color profiles.

Color-managed Images

Implementations of SVG Color are required to color-manage all images. The embedded profile is used (if there is no embedded profile, sRGB is assumed, for RGB images).

If a referenced image contains color profile information, a Color-managed User Agent MUST use that profile to render the image .

If a referenced image contains no color profile information, a Color-managed User Agent MUST use the sRGB profile to render the image .

Color syntax

sRGB colors

<color>

Example:

    <circle fill="rgb(205,133,63)"/>
    <circle fill="peru"/>
    <circle fill="rgb(80.392%, 52.157%, 24.706%)"/>
    <circle fill="#CD853F"/>

Note: Same syntax as SVG 1.1, extended color keyword list compared to SVG Tiny 1.2

As with SVG 1.1 and SVG Tiny 1.2, colors may be specified in the sRGB color space (see [sRGB]). Five syntactical forms are specified for SVG Color, and all of them must be supported in a conforming Color-managed User Agent:

Three digit hex — #rgb
Each hexadecimal digit, in the range 0 to F, represents one sRGB color component in the order red, green and blue. The digits A to F may be in either uppercase or lowercase. The value of the color component is obtained by replicating digits, so 0 become 00, 1 becomes 11, F becomes FF. This compact syntactical form can represent only 4096 colors. Examples: #000 (i.e. black) #fff (i.e. white) #6CF (i.e. #66CCFF, rgb(102, 204, 255)).
Six digit hex — #rrggbb
Each pair of hexadecimal digits, in the range 0 to F, represents one sRGB color component in the order red, green and blue. The digits A to F may be in either uppercase or lowercase.This syntactical form, originally introduced by HTML, can represent 16777216 colors. Examples: #9400D3 (i.e. a dark violet), #FFD700 (i.e. a golden color).
Integer functional — rgb(rrr, ggg, bbb)
Each integer represents one sRGB color component in the order red, green and blue, separated by a comma and optionally by white space. Each integer is in the range 0 to 255. This syntactical form can represent 16777216 colors. Examples: rgb(233, 150, 122) (i.e. a salmon pink), rgb(255, 165, 0) (i.e. an orange).
Float functional — rgb(R%, G%, B%)
Each percentage value represents one sRGB color component in the order red, green and blue, separated by a comma and optionally by white space. For colors inside the sRGB gamut, the range of each component is 0.0% to 100.0% and an arbitrary number of decimal places may be supplied. Scientific notation is not supported. This syntactical form can represent an arbitrary range of colors, completely covering the sRGB gamut. Color values where one or more components are below 0.0% or above 100.0% represent colors outside the sRGB gamut. Examples: rgb(12.375%, 34.286%, 28.97%).
Color keyword
Originally implemented in HTML browsers and eventually standardized in SVG 1.1, the full list of color keywords and their corresponding sRGB values are given in the SVG 1.1 specification. SVG Tiny 1.2 required only a subset of these, sixteen color keywords. SVG Color requires the full set to be supported.

All the SVG 1.1 syntactic forms for an sRGB color, including the full set of color keywords, shall be supported by a Color-managed User Agent, regardless of the base language profile of SVG.

Since all Color-managed User Agent are color management capable, the rendering requirements for sRGB colors are more strict than for SVG 1.1 or SVG Tiny 1.2 User Agents, where color management is optional.

When an sRGB color is used - because it is the sole color specification, or in a permitted fallback situation - a conformant Color-managed User Agent shall render it in conformance with the ICC profile for sRGB to obtain the desired color appearance.

ICC colors

<fallback> icc-color(<name> [,<icccolorvalue>]*)

Example:

    <color-profile name="acmecmyk" xlink:href="http://printers.example.com/acmecorp/model1234"/>
    <circle fill="#CD853F icc-color(acmecmyk, 0.11, 0.48, 0.83, 0.00)"/>

Note: same syntax as SVG 1.1.

SVG Color uses the extended ICC color specification from SVG 1.1. In SVG Tiny 1.2, this was not supported; an SVG Tiny 1.2 user agent which also conforms to this specification is required to support it. In SVG 1.1, parsing the syntax was required but implementing the ICC colour itself was optional, as indicated by phrases such as "If ICC-based colors are provided and the SVG user agent supports ICC color, then...". An SVG 1.1 user agent which also conforms to this specification "supports ICC color" for the purposes of conforming to SVG 1.1.

As with SVG Full 1.1, SVG Color content may specify color using an ICC profile (see [ICC42]); an sRGB fallback must still be provided.

A Color-managed User Agent searches the color profile description database for a color profile description entry whose name descriptor matches <name> and uses the last matching entry that is found; painting shall be done using the given ICC color, where the comma-separated list (with optional white space) of <icccolorvalue>'s is a set of ICC-profile-specific color values, expressed as <number>s (see ICC colors). If no match is found, then the fallback sRGB color is used.

If ICC-based colors are provided, a Color-managed User Agent MUST use the the ICC-based color in preference to the sRGB fallback color, unless the ICC color profile cannot be used (is unavailable, malformed, or uses an unsupported profile connection space).

When rendering, if both ICC and sRGB fallback colors are provided and the referenced ICC profile ican be used, a Color-managed User Agent MUST render using the ICC color values, and using the specified ICC profile as the input profile.

LAB color

<fallback> cielab(<Lightness>, <a> <b> <WP>?) |
<fallback> cielchab(<Lightness> <Chroma>, <Hue> <WP>?)

Example:

    <circle fill="#CD853F cielab(62.253188, 23.950124, 48.410653)"/>
    <circle fill="#CD853F cielch(62.253188, 54.011108, 63.677091)"/>
    <circle fill="#CD853F cielab(62.253188, 23.950124, 48.410653, D65)"/>

Note: new in this specification.

A Color-managed User Agent directly uses the CIE LAB or CIE LCHab values, where the comma-separated list (with optional white space) of <icccolorvalue>'s is a set of Lightness, a and b or Lightness, Hue and Chroma values, expressed as <number>s.

An optional white point may be specified, of the form Dnn. This corresponds to the whitepoint of a daylight source of nn00 Kelvin (for example, D65 is 6500 Kelvin). If not specified, the lacuna value is D50 which is the whitepoint defined by the CIE for CIELab profile connection space.

A fallback sRGB color must still be provided, for non-colormanaged user agents.

ICC named color

<fallback> icc-named-color(<name>, <namedColor>)

Example:

      <color-profile name="FooColors" xlink:href="http://swatches.example.com/Foo"/>
      <circle fill="#CD853F icc-color(FooColors, Sandy23C"/>

Note: new in this specification.

SVG Color introduces the ability to specify a color using a 'Named Color Profile'.

A Color-managed User Agent searches the color profile description database for a color profile description entry whose name descriptor matches <name> and uses the last matching entry that is found; painting shall be done using the given ICC color, where namedColor is a <string> indicating the named color to use.

If ICC-based named colors are provided, a conformant Color-managed User Agent MUST use the the ICC-based named color in preference to the sRGB fallback color, unless the ICC named color profile is unavailable, malformed, or uses a profile connection space other than CIE XYZ or CIE LAB.

When an ICC named color is used, a conformant Color-managed User Agent shall render it in conformance with the specified ICC profile to obtain the desired color appearance.

Uncalibrated device color

<fallback> device-gray(<gray>) |
<fallback> device-rgb(<red> <green> <blue>) |
<fallback> device-cmyk(<cyan> <magenta> <yellow> <black>) |
<fallback> device-nchannel(<number>+) |

Note: new in this specification.

Example:

      <circle fill="#CD853F device-cmyk(0.11, 0.48, 0.83, 0.00)"/>

SVG Color also introduces a method of specifying uncalibrated device colors. This is sometimes useful in print workflows, for example to produce patches of known ink density used for quality control purposes.

A Color-managed User Agent which supports the indicated class of output device will pass the values through without color management. If the class of output device (for example, cmyk) is not supported, then the fallback sRGB color is used.

As these are uncalibrated, any interpolation or compositing occurs using the fallback sRGB color value.

Completely different syntax in this version of the specification, responding to feedback from previous last call and aligning with industry practice.

Specifying paint

The definition of paint in SVG Tiny 1.2 [SVGT12] is extended by this specification to add the icc-color values from paint in SVG Full 1.1 [SVG11] and also to add new values for named colors, CIELAB colors, and uncalibrated device colors.

<paint> :       none |
currentColor |
<color> |
fallback <icccolor> |
fallback <cielabcolor> |
fallback <iccnamedcolor> |
fallback <devicecolor> |
<FuncIRI> [ none | currentColor | <color>] |
<system paint> |
inherit
none
Indicates that no paint shall be applied.
currentColor
Indicates that painting shall be done using the color specified by the current animated value of the 'color' property. This mechanism is provided to facilitate sharing of color attributes between parent grammars such as other (non-SVG) XML. This mechanism allows you to define a style in your HTML which sets the 'color' property and then pass that style to the SVG user agent so that your SVG text will draw in the same color.
<color>
an sRGB color.
<icccolor>
An ICC color, plus sRGB fallback..
<cielabcolor>
A CIE Lab or CIE LCHab color, plus sRGB fallback.
<iccnamedcolor>
An ICC named color, plus sRGB fallback.
<devicecolor>
An uncalibrated device color, plus sRGB fallback.
<FuncIRI> [ none | currentColor | <color>]
The <FuncIRI> specifies a paint server such as a gradient. The fragment identifier of the <FuncIRI> provides a link to the paint server (e.g., a gradient or 'solidColor' ) that shall be used to paint the current object. The IRI reference must be a Local IRI reference . If the Local IRI reference is not valid (e.g., it points to an object that doesn't exist or the object is not a valid paint server), then the fallback value (if specified) is used; otherwise it must be treated as if none was specified.
<system paint>
A System Paint Server

Note that by default, color interpolation occurs in the sRGB color space, even if an ICC-based color specification is provided, unless the 'color-interpolation' property is set to one of the CIE Lab color spaces. If an sRGB color interpolation space is specified, all ICC-based colors used for the interpolation must be converted into the sRGB interpolation colorspace.

Specifying a solidColor paint server

The solidColor element in SVG Tiny 1.2 [SVGT12] is extended by this specification to add the icc-color values from paint in SVG Full 1.1 [SVG11] and also to add new values for named colors, CIELAB colors, and uncalibrated device colors.

'solid-color'
Value: currentColor |
<color> |
fallback <icccolor> |
fallback <cielabcolor> |
fallback <iccnamedcolor> |
fallback <devicecolor> |
<system paint> |
inherit
Initial: black
Applies to: 'solidColor' elements
Inherited: no
Percentages: N/A
Media: visual
Animatable: yes
Computed value:   Specified <color> value, except inherit

Specifying a viewportFill

The viewportFill element in SVG Tiny 1.2 [SVGT12] is extended by this specification to add the icc-color values from paint in SVG Full 1.1 [SVG11] and also to add new values for named colors, CIELAB colors, and uncalibrated device colors.

'viewport-fill'
Value: none |
currentColor |
<color> |
fallback <icccolor> |
fallback <cielabcolor> |
fallback <iccnamedcolor> |
fallback <devicecolor> |
<system paint> |
inherit
Initial: none
Applies to: viewport-creating elements
Inherited: no
Percentages: N/A
Media: visual
Animatable: yes
Computed value:   "none" or specified <color> value, except inherit

Specifying gradients

The gradients in SVG Tiny 1.2 [SVGT12] are extended by this specification. The 'stop-color' property s extended by this specification to add the icc-color values from paint in SVG Full 1.1 [SVG11] and also to add new values for named colors, CIELAB colors, and uncalibrated device colors. The color-interpolation property is extended by this specification to add new values using the CIE L*a*b* color space.

The 'stop-color' property

The 'stop-color' property indicates what color to use at that gradient stop. The keyword currentColor and ICC colors can be specified in the same manner as within a <paint>. This is the same syntax as is used in SVG 1.1; the conformance criteria are however more stringent as color management is no longer optional.

'stop-color'
Value:   currentColor |
<color> |
fallback <icccolor> |
fallback <cielabcolor> |
fallback <iccnamedcolor> |
fallback <devicecolor> |
<system paint> |
inherit
Initial:   black
Applies to:   'stop' elements
Inherited:   no
Percentages:   N/A
Media:   visual
Animatable:   yes

If any stop-color uses a cmyk color space and stop-opacity is set to any value other than fully opaque, the result is undefined by this specification. Even for f ully opaque gradients, the result of interpolating cmyk colors may be unexpected. In general, the use of cmyk (either calibrated or uncalibrated) in gradients is discouraged.

Color interpolation

The color-interpolation property, not in SVG Tiny 1.2 but used in SVG 1.1 [SVG11], is extended by this specification to add new values using the CIE L*a*b* color space. Both the cartesian (CIE-Lab) and polar (CIE-LCHab) forms are supported.

A Color-managed User Agent MUST use the color space defined by color-interpolation for calculations when interpolating between gradient stops, and when alpha compositing of graphics elements into the current background.

'color-interpolation'
Value:   auto | sRGB | linearRGB | CIE-Lab | CIE-LCHab | inherit
Initial:   sRGB
Applies to:   container elements, graphics elements and 'animateColor'
Inherited:   yes
Percentages:   N/A
Media:   visual
Animatable:   yes
auto
Indicates that the user agent can choose any of the color spaces - sRGB, linearRGB, CIE-Lab or CIE-LCHab- for color interpolation. This option indicates that the author doesn't require that color interpolation occur in a particular color space.
sRGB
Indicates that color interpolation must occur in the sRGB color space defined by [sRGB].
linearRGB
Indicates that color interpolation must occur in the linearized RGB color space (sRGB with a linear transfer function) as defined in [sRGB].
CIE-Lab
Indicates that color interpolation must occur in the cartesian L*a*b* color space defined by [CIE15].
CIE-LCHab
Indicates that color interpolation must occur in the polar L*CHab color space defined by [CIE15].

The 'color-interpolation' property specifies the color space for gradient interpolations and alpha compositing.

When a child element is blended into a background, the value of the 'color-interpolation' property on the child determines the type of blending, not the value of the 'color-interpolation' on the parent. For gradients which make use of the xlink:href attribute to reference another gradient, the gradient uses the 'color-interpolation' property value from the gradient element which is directly referenced by the 'fill' or 'stroke' property. When animating colors, color interpolation is performed according to the value of the 'color-interpolation' property on the element being animated.

Color profile descriptions

Overview of color profile descriptions

The International Color Consortium has established a standard, the ICC Profile [ICC32], for documenting the color characteristics of input and output devices. Using these profiles, it is possible to build a transform and correct visual data for viewing on different devices.

A color profile description provides the bridge between an ICC profile and references to that ICC profile within SVG content. The color profile description is added to the user agent's list of known color profiles and then used to select the relevant profile. The color profile description contains descriptors for the location of the color profile on the Web, a name to reference the profile and information about rendering intent.

The 'color-profile' element

Attribute definitions:

xlink:href = "<iri>"
The location of an ICC profile resource.
Animatable: no.
local = "<string>"
The unique ID for a locally stored color profile. <string> is the profile's unique ID as specified by International Color Consortium.
If both the xlink:href and the local attributes are specified, then the user agent MUST search the local system for the locally stored color profile first, and, if not available locally, then attempt to use the resource identified by the xlink:href attribute.
(Note: Profile description fields do not represent a profile's unique ID. With current ICC proposals, the profile's unique ID is an MD5-encoded value within the profile header.).
Animatable: no.
name = "<name>"
The name which is used as the first parameter for icc-color specifications within 'fill', 'stroke', 'stop-color', 'flood-color' and 'lighting-color' property values to identify the color profile to use for the ICC color specification and the name which can be the value of the 'color-profile' property. Note that if <name> is not provided, it will be impossible to reference the given color profile description.
The name "sRGB" is predefined; any color profile descriptions with <name> set to "sRGB" MUST be ignored. When used in a style sheet, for consistency with CSS lexical scanning and parsing rules, the keyword "sRGB" MUST be case-insensitive. However, it is recommended that the mixed capitalization "sRGB" SHOULD be used for consistency with common industry practice.

Animatable: no.
rendering-intent = "auto | perceptual | relative-colorimetric | saturation | absolute-colorimetric"

'rendering-intent' permits the specification of a color profile rendering intent other than the default. 'rendering-intent' is applicable primarily to color profiles corresponding to CMYK color spaces. The different options cause different methods to be used for translating colors to the color gamut of the target rendering device:

auto
This is the default behavior. The user agent determines the best intent based on the content type.
For image content containing an embedded profile, the User Agent MUST use the intent specified within the profile. Otherwise, the user agent MUST use the current profile and force the intent, overriding any intent that might be stored in the profile itself.
perceptual

This method is often the preferred choice for images, especially when there are substantial differences between the source and destination (such as a CRT display image reproduced on a reflection print). It takes the colors of the source image and re-optimizes the appearance for the destination medium using proprietary methods. This re-optimization may result in colors within both the source and destination gamuts being changed, although perceptual transforms are supposed to maintain the basic artistic intent of the original in the reproduction. They will not attempt to correct errors in the source image.

NOTE With v2 ICC profiles there is no specified perceptual reference medium, which can cause interoperability problems. When v2 ICC profiles are used it may be safer to use the media-relative colorimetric rendering intent with black point compensation, instead of the perceptual rendering intent, unless the specific source and destination profiles to be used have been checked to ensure the combination produces the desired result.

This method SHOULD maintain relative color values among the pixels as they are mapped to the target device gamut. This method MAY change pixel values that were originally within the target device gamut, in order to avoid hue shifts and discontinuities and to preserve as much as possible the overall appearance of the scene.
saturation

This option was created to preserve the relative saturation (chroma) of the original, and to keep solid colors pure. However, it experienced interoperability problems like the perceptual intent, and as solid color preservation is not amenable to a reference medium solution using v4 profiles does not solve the problem. Use of this rendering intent is not recommended unless the specific source and destination profiles to be used have been checked to ensure the combination produces the desired result.

This option SHOULD preserve the relative saturation (chroma) values of the original pixels. Out of gamut colors SHOULD be converted to colors that have the same saturation but fall just inside the gamut.
relative colorimetric

Media-relative colorimetric is required to leave source colors that fall inside the destination medium gamut unchanged relative to the respective media white points. Source colors that are out of the destination medium gamut are mapped to colors on the gamut boundary using a variety of different methods.

NOTE The media-relative colorimetric rendering intent is often used with black point compensation, where the source medium black point is mapped to the destination medium black point as well.

This method MUST map the source white point to the desination white point. If black point compensation is in use, the source black point MUST also be mapped to the destination black point. Adaptation algorithms MAY be used to adjust for the change in white point. Relative relationships of colors inside both source and destination gamuts SHOULD be preserved. Relative relationships of colors outside the destination gamut MAY be changed.
absolute colorimetric

ICC-absolute colorimetric is required to leave source colors that fall inside the destination medium gamut unchanged relative to the adopted white (a perfect reflecting diffuser). Source colors that are out of the destination medium gamut are mapped to colors on the gamut boundary using a variety of different methods. This method produces the most accurate color matching of in-gamut colors, but will result in highlight clipping if the destination medium white point is lower than the source medium white point. For this reason it is recommended for use only in applications that need exact color matching and where highlight clipping is not a concern.

This method MUST disable white point matching and black point matching when converting colors.
In general, this option is not recommended.

Animatable: no.

Fallback behaviour needs to be specified, for when the requested rendering intent does not have a corresponding table in the profile; or when all rendering-intents are provided using the same table.

Color syntax

The EBNF grammar is as used in the XML specification, with the addition of a case-insensitive literal: characters in the ASCII range (only) are case-insensitive. ~"Hello" will match (H|h)(e|e)(l|L)(l|L)(o|O). This makes the productions much easier to read.

?optional, zero or one
+one or more
*zero or more
|alternation
"string"literal
~"string"case-insensitive literal
[]a character range
[^]excluded character range
()grouping
    icccolor ::= 
    ~"icc-color(" name (comma-wsp number)+ ")" 
    
    iccnamedcolor ::= 
    ~"icc-named-color(" name comma-wsp namedColor ")" 
    
    cielabcolor ::=
    ~"cielab(" lightness comma-wsp a-value comma-wsp b-value WP? ")" 
    
    cielchabcolor ::=
    ~"cielchab(" lightness comma-wsp chroma comma-wsp hue WP? ")" 
    
    devicecolor ::=
    device-gray | devicergb | devicecmyk | devicenchannel
    
    devicegray ::=
    ~"device-gray(" gray ")"
    
    devicergb ::=
    ~"device-rgb(" red green blue ")"
    
    devicecmyk ::=
    ~"device-cmyk(" cyan magenta yellow >black ")"
    
    devicenchannel ::=
    ~"device-nchannel(" number+ ")"
    
    name ::=
    namestartchar (namechar)*
    
    lightness ::=
    number
    
    a-value ::=
    number
    
    b-value ::=
    number
    
    chroma ::=
    number
    
    hue ::=
    number
    
    WP ::=
    comma-wsp "D" [0-9] [0-9]
    
    gray ::=
    number
    
    red ::=
    number
    
    green ::=
    number
    
    blue ::=
    number
    
    cyan ::=
    number
    
    magenta ::=
    number
    
    yellow ::=
    number
    
    black ::=
    number
    
    namedColor ::=
    name
    
    fallback ::=
    color
    
    color  ::= 
    "#" hexdigit hexdigit hexdigit (hexdigit hexdigit hexdigit)?
    | ~"rgb(" wsp* integer comma integer comma integer wsp* ")"
    | ~"rgb(" wsp* integer "%" comma integer "%" comma integer "%" wsp* ")"
    | color-keyword
    
    hexdigit ::= 
    [0-9A-Fa-f]
    
    number ::= 
    sign? digit-sequence? "." digit-sequence
    
    sign::=
    "+" | "-"
    
    integer ::=
    digit-sequence
    
    digit-sequence ::=
    [0-9]+
    
    namestartchar ::=   	
    ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [
    #xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] |
    [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] |
    [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
     
    namechar ::=   	
    namestartchar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] |
    [#x203F-#x2040]
    
    
    comma-wsp ::=
    (wsp+ comma? wsp*) | (comma wsp*)
    
    comma ::=
    ","
    
    wsp ::=
    (#x20 | #x9 | #xD | #xA)
    
    color-keyword ::=
    ~"aliceblue" | ~"antiquewhite" | ~"aqua" | ~"aquamarine" | ~"azure" | ~"beige" | 
    ~"bisque" | ~"black" | ~"blanchedalmond" | ~"blue" | ~"blueviolet" | ~"brown" | 
    ~"burlywood" |~"cadetblue" | ~"chartreuse" | ~"chocolate" | ~"coral" | ~"cornflowerblue" | 	
    ~"cornsilk" | ~"crimson" | ~"cyan" | ~"darkblue" | ~"darkcyan" | ~"darkgoldenrod" | 
    ~"darkgray" | ~"darkgreen" | ~"darkgrey" | ~"darkkhaki" | ~"darkmagenta" | ~"darkolivegreen" | 
    ~"darkorange" | ~"darkorchid" | ~"darkred" | ~"darksalmon" | ~"darkseagreen" | ~"darkslateblue" | 
    ~"darkslategray" | ~"darkslategrey" | ~"darkturquoise" | ~"darkviolet" | ~"deeppink" | ~"deepskyblue" | 
    ~"dimgray" | ~"dimgrey" | ~"dodgerblue" | ~"firebrick" | ~"floralwhite" | ~"forestgreen" | 
    ~"fuchsia" | ~"gainsboro" | ~"ghostwhite" | ~"gold" | ~"goldenrod" | ~"gray" | 
    ~"grey" | ~"green" | ~"greenyellow" | ~"honeydew" | ~"hotpink" | ~"indianred" | 
    ~"indigo" | ~"ivory" | ~"khaki" | ~"lavender" | ~"lavenderblush" | ~"lawngreen" | 
    ~"lemonchiffon" | ~"lightblue" | ~"lightcoral" | ~"lightcyan" | ~"lightgoldenrodyellow" | ~"lightgray" | 
    ~"lightgreen" | ~"lightgrey" | ~"lightpink" | ~"lightsalmon" | ~"lightseagreen" | ~"lightskyblue" | 
    ~"lightslategray" | ~"lightslategrey" | ~"lightsteelblue" | ~"lightyellow" | ~"lime" | 
    ~"limegreen" | ~"linen" | ~"magenta" | ~"maroon" | ~"mediumaquamarine" | ~"mediumblue" | 
    ~"mediumorchid" | ~"mediumpurple" | ~"mediumseagreen" | ~"mediumslateblue" | ~"mediumspringgreen" | ~"mediumturquoise" |
    ~"mediumvioletred" | ~"midnightblue" | ~"mintcream" | ~"mistyrose" | ~"moccasin" | ~"navajowhite" | 
    ~"navy" | ~"oldlace" | ~"olive" | ~"olivedrab" | ~"orange" | ~"orangered" | 
    ~"orchid" | ~"palegoldenrod" | ~"palegreen" | ~"paleturquoise" | ~"palevioletred" | ~"papayawhip" | 
    ~"peachpuff" | ~"peru" | ~"pink" | ~"plum" | ~"powderblue" | ~"purple" | 
    ~"red" | ~"rosybrown" | ~"royalblue" | ~"saddlebrown" | ~"salmon" | ~"sandybrown" | 
    ~"seagreen" | ~"seashell" | ~"sienna" | ~"silver" | ~"skyblue" | ~"slateblue" | 
    ~"slategray" | ~"slategrey" | ~"snow" | ~"springgreen" | ~"steelblue" | ~"tan" | 
    ~"teal" | ~"thistle" | ~"tomato" | ~"turquoise" | ~"violet" | ~"wheat" | 
    ~"white" | ~"whitesmoke" | ~"yellow" | ~"yellowgreen" 
  

Definitions

color
A sensation caused by the spectral properties of light interacting with the human visual system (eye and brain).
color appearance
Color-appearance models extend basic colorimetry, to the prediction of color matches and color appearance across varying viewing conditions, taking into account not just the colorimetry of the color patch in question but also its size and the other colors wehich surround it.
color management
A means of ensuring consistent color reproduction on a range of devices, by taking into account the colorimetric characteristics, gamut and white point of the source image and the output device.
color space
A geometric space, usually three dimensional, in which a range of colors may be placed colorimetricaly.
colorimetric
A color which is objectively measured and expressed as tristimulus terms, such as CIE XYZ or CIE LAB. Two colors which have the same colorimerty will appear the same to a normal human observer, even if their spectra are very different.
gamut
The subset of colors which can be accurately represented in a given colorspace or displayed on a given output device.
metamerism
When the color of two physical materials match under one light source, but do not match under different lighting. This is caused by very different reflectance spectra, which only give matching tristimulus values with a restricted range of lighting spectra.
perceptually uniform
The closeness of two points in a color space relates to how similar they will appear, but in some color spaces the definition of 'closeness' depends on the position in the space (colors are clumped together or spread apart), leading to complex formulae to compute closeness. For a given color space, if the simple geometric distance of any two points strongly relates to how similar they will appear, that color space is said to be perceptually uniform.

References

Normative References

[CIE15]
International Commission on Illumination (CIE). Colorimetry, 3rd Edition. Publication CIE 15:2004, ISBN 3-901-906-33-9
Available at http://www.cie.co.at/publ/abst/15-2004.html
[ICC42]
International Color Consortium. Specification ICC.1:2004-10 (Profile version 4.2.0.0) Image technology colour management — Architecture, profile format, and data structure.
Available at http://www.color.org/ICC1V42.pdf
[SRGB]
IEC 61966-2-1 (1999-10) - "Multimedia systems and equipment - Colour measurement and management - Part 2-1: Colour management - Default RGB colour space - sRGB, ISBN: 2-8318-4989-6 ­ ICS codes: 33.160.60, 37.080 ­ TC 100 ­ 51 pp.
Available at: http://domino.iec.ch/webstore/webstore.nsf/artnum/025408.
[SVG12]
Scalable Vector Graphics (SVG) 1.2 Specification, Dean Jackson editor, W3C, 27 October 2004 (Working Draft). See http://www.w3.org/TR/2004/WD-SVG12-20041027/

Informative References

[BetaRGB]
Beta RGB, Bruce Justin Lindbloom, 2003.
[SVG11]
Scalable Vector Graphics (SVG) 1.1, J. Ferraiolo, 藤沢 淳 (Fujisawa Jun), D. Jackson, eds. World Wide Web Consortium,14 January 2003.
Latest version available at: http://www.w3.org/TR/SVG11/
[SVGColorPrimer]
SVG Color Primer, Chris Lilley, Anthony Grasso, eds. World Wide Web Consortium, 01 October 2009.
Latest version available at: http://www.w3.org/TR/SVGColorPrimer12

Changes

The following changes ave been made, relative to the First Public Working Draft: