14 January 2003, 翻訳更新: 2010/04/27

12 色


目次

12.1 概要

SVG においては全ての色は sRGB 色空間( [SRGB] 参照)で指定される。 SVG-UAは、少なくとも CSS2 仕様により定められている 色単位 ( color units )と ガンマ補正 ( minimal gamma correction rules )で指定される色の振る舞いに対する要求に適合するものとする。

All SVG colors are specified in the sRGB color space (see [SRGB]). At a minimum, SVG user agents shall conform to the color behavior requirements specified in the color units section and the minimal gamma correction rules defined in the CSS2 specification.

更に、 SVG 内容では ICC プロファイル( [ICC32] 参照)を利用する代替の色指定も指定することができる。 SVG-UAが ICC 色をサポートしている場合は ICC ベースの色指定が(もし与えられているなら) sRGB 色指定より優先される。 ICC ベースの色指定が与えられたとしても色補間は RGB 色空間で行われることに注意( 'color-interpolation' プロパティを見よ)。

Additionally, SVG content can specify an alternate color specification using an ICC profile (see [ ICC32]). If ICC-based colors are provided and the SVG user agent supports ICC color, then the ICC-based color takes precedence over the sRGB color specification. Note that color interpolation occurs in an RGB color space even if an ICC-based color specification is provided (see 'color-interpolation').

12.2 'color' プロパティ

'color' プロパティは、 'fill', 'stroke', 'stop-color', 'flood-color', 'lighting-color' プロパティに対し間接的に与え得る値( currentColor )を提供するために利用される。

The 'color' property is used to provide a potential indirect value (currentColor) for the 'fill', 'stroke', 'stop-color', 'flood-color', 'lighting-color' properties.

'color'
値:   <color> | inherit
初期値:   UAに依存
適用対象:   'fill', 'stroke', 'stop-color', 'flood-color', 'lighting-color' プロパティが適用される要素
継承:   有り
パーセント:   N/A
メディア:   視覚
アニメーション  
Value:   <color> | inherit
Initial:   depends on user agent
Applies to:   elements to which properties 'fill', 'stroke', 'stop-color', 'flood-color', 'lighting-color' apply
Inherited:   yes
Percentages:   N/A
Media:   visual
Animatable:   yes

この仕様で与えられる追加の情報を除き、このプロパティの正式な定義は [CSS2] で与えられる。

Except for any additional information provided in this specification, the normative definition of the property is in [ CSS2].


12.3 カラープロファイル記述


12.3.1 カラープロファイル記述の概観

International Color Consortium は、入力装置と出力装置の色特性を文書化するための標準 ICC プロファイル [ICC32] を確立した。これらのプロファイルの利用により、異なる装置間にわたる変換と正確な視覚データの再現が可能になる。

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.

カラープロファイル記述 ( color profile description )は ICC プロファイルと SVG 内容におけるその ICC プロファイルへの参照との間の橋渡しを提供する。カラープロファイル記述は、UAが持つ既知のカラープロファイルのリストに追加され、適切なプロファイルの選択に用いられる。カラープロファイル記述は、カラープロファイルのウェブにおける場所, プロファイルの参照名, 描画インテント( rendering intent )についての情報を表す記述子を含む。

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.


12.3.2 プロファイル記述を定義する2つの方法

カラープロファイル記述は次のいずれかの方法で指定される:

Color profile descriptions can be specified in either of the following ways:

同じ name 値のカラープロファイルが 'color-profile' 要素と CSS スタイルシート内の @color-profile 規則の両方で認識された場合、UAはまず @color-profile 規則を優先してプロファイルの特定を試みることになる。

If a color profile with the same name value has been identified by both a 'color-profile' element and @color-profile rules within a CSS style sheet, then the user agent shall first attempt to locate the profile by using the specifications in the @color-profile rules first.


12.3.3 'color-profile' 要素

<!ENTITY % SVG.color-profile.extra.content "" >
<!ENTITY % SVG.color-profile.element "INCLUDE" >
<![%SVG.color-profile.element;[
<!ENTITY % SVG.color-profile.content
    "( %SVG.Description.class; %SVG.color-profile.extra.cont\
ent; )*"
>
<!ELEMENT %SVG.color-profile.qname; %SVG.color-profile\
.content; >
<!-- end of SVG.color-profile.element -->]]>
<!ENTITY % SVG.color-profile.attlist "INCLUDE" >
<![%SVG.color-profile.attlist;[
<!ATTLIST %SVG.color-profile.qname;
    %SVG.Core.attrib;
    %SVG.XLink.attrib;
    local CDATA #IMPLIED
    name CDATA #REQUIRED
    rendering-intent ( auto | perceptual | relative-colorimetric | saturation |
                       absolute-colorimetric ) 'auto'
>

属性定義:

xlink:href = " <uri>"
ICC プロファイルリソースの位置。
アニメーション:不可
The location of an ICC profile resource.
Animatable: no.
local = "<string>"
ローカルに格納されているカラープロファイルを識別する一意的な ID 。<string> は International Color Consortium により定められているプロファイル固有の ID を表す。 xlink:hreflocal 属性の両方が指定された場合、UAはシステムにローカルに格納されているカラープロファイルの検索を先に行い、存在しなければ、 xlink:href 属性で特定されるリソースの利用を試みることになる。(注意:プロファイル記述フィールドは、プロファイルの識別 ID を表すわけではない 。現在の ICC 提案では、プロファイルの識別 ID はプロファイルヘッダの MD5 エンコード値である。)
アニメーション:不可
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 shall 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>"
ICC 色指定に利用するカラープロファイルを特定するために、 'fill', 'stroke', 'stop-color', 'flood-color', 'lighting-color' プロパティで値の最初のパラメタとして利用される icc-color 指定の名前であり、 'color-profile' プロパティの値として用いることができる名前。注意:<name> が与えられていない場合、カラープロファイル記述を参照することができなくなる。名前 "sRGB" は定義済みであり、 <name> が "sRGB" に設定されたカラープロファイル記述は無視される。 CSS 字句走査解析規則 との整合性においては、キーワード "sRGB" の文字の大小は区別されない。しかしながら、業界慣行との整合性を保つにはこの大文字混じりの "sRGB" の使用が推奨される。
アニメーション:不可
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" will be ignored. For consistency with CSS lexical scanning and parsing rules, the keyword "sRGB" is case-insensitive; however, it is recommended that the mixed capitalization "sRGB" be used for consistency with common industry practice.
Animatable: no.
rendering-intent = "auto | perceptual | relative-colorimetric | saturation | absolute-colorimetric"

'rendering-intent' はカラープロファイル描画インテントを既定のもの以外にすることを可能にする。 'rendering-intent' は主に CMYK 色空間に対応するカラープロファイルに適用される。それぞれの値は、描画対象の装置の色域( color gamut )に色を変換する際に用いられるそれぞれ異なる手法に対応する:

auto
これが既定の振る舞いである。UAは内容の種類に応じて最良のインテントを決定する。プロファイルが埋め込まれた画像内容に対しては、プロファイルで指定されたインテントが望ましいものであるとみなされることになる。他の場合、UAは現在のプロファイルを利用し、プロファイル自身に格納され得る全てのインテントを強制的に上書きすることになる。
perceptual
この手法は、画像においてはしばしば好まれる選択であり、色と色との関係を保つ。これは、対象装置の色域に変換されるときに画素間における色の相対関係がなるべく維持されるようにする。色相の変化と色の不連続性を避け、風景の全体的な外観を可能な限り保つため、一部の画素の色は対象装置の色域に含まれていても変更されることがある。
saturation
元の画素の色の彩度(クロマ - chroma )の相対関係を保つ。色域外の色は色域内にぎりぎり入る同じ彩度の色に変換される。
relative colorimetric
色域内の色はそのままにされる。この手法では通常、色域外の色は色域内にぎりぎり入る同じ明度( lightness )の色に変換される。
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, it shall be assumed that the intent specified within the profile is the desired intent. Otherwise, the user agent shall use the current profile and force the intent, overriding any intent that might be stored in the profile itself.
perceptual
This method, often the preferred choice for images, preserves the relationship between colors. It attempts to maintain relative color values among the pixels as they are mapped to the target device gamut. Sometimes pixel values that were originally within the target device gamut are changed in order to avoid hue shifts and discontinuities and to preserve as much as possible the overall appearance of the scene.
saturation
Preserves the relative saturation (chroma) values of the original pixels. Out of gamut colors are converted to colors that have the same saturation but fall just inside the gamut.
relative colorimetric
Leaves colors that fall inside the gamut unchanged. This method usually converts out of gamut colors to colors that have the same lightness but fall just inside the gamut.
absolute colorimetric
Disables white point matching when converting colors. This option is generally not recommended.

Animatable: no.

12.3.4 CSS によるスタイル付けにおける @color-profile

文書に CSS によるスタイル付けがなされている場合は、カラープロファイル記述の指定に @color-profile 規則が利用できる。総体的な書式は:

When the document is styled using CSS, the @color-profile rule can be used to specify a color profile description. The general form is:

@color-profile { <color-profile-description> }

ここで <color-profile-description> の書式は:

where the <color-profile-description> has the form:

記述子: 値;
[...]
記述子: 値;
descriptor: value;
[...]
descriptor: value;

それぞれの @color-profile 規則は全てのカラープロファイル記述子に対する値を暗黙的または明示的に指定する。規則において明示的に値が与えられていない記述子はこの仕様で挙げられている各記述子の初期値をとる。これらの記述子は単にこれらが定義された @color-profile 規則の文脈において適用されるものであり、文書言語の枠組みにおいて要素に適用されるものではない。したがって、どの要素に記述子が適用されるか、あるいは子要素への値の継承というような概念は存在しない。

Each @color-profile rule specifies a value for every color profile descriptor, either implicitly or explicitly. Those not given explicit values in the rule take the initial value listed with each descriptor in this specification. These descriptors apply solely within the context of the @color-profile rule in which they are defined, and do not apply to document language elements. Thus, there is no notion of which elements the descriptors apply to, or whether the values are inherited by child elements.

以下は <color-profile-description> の記述子である:

The following are the descriptors for a <color-profile-description>:

'src' (記述子)
値: sRGB | <local-profile> | <uri> | (<local-profile> <uri>) | inherit
初期値: sRGB
メディア: 視覚
Values: sRGB | <local-profile> | <uri> | (<local-profile> <uri>) | inherit
Initial: sRGB
Media: visual
sRGB
ソースプロファイルは sRGB 色空間。 CSS 字句走査解析規則 との整合性においては、キーワード "sRGB" の文字の大小は区別されない。しかしながら、業界慣行との整合性を保つにはこの大文字混じりの "sRGB" の使用が推奨される。
The source profile is the sRGB color space. For consistency with CSS lexical scanning and parsing rules, the keyword "sRGB" is case-insensitive; however, it is recommended that the mixed capitalization "sRGB" be used for consistency with common industry practice.
<local-profile>
ソースプロファイルはローカルに保持されているプロファイル。<local-profile> の構文は:
"local(" + <string> + ")"
ここで <string> は International Color Consortium により定められたプロファイルの識別 ID である。(注意:プロファイル記述フィールドは、プロファイルの識別 ID を表現するわけではない 。現在の ICC 提案では、プロファイルの識別 ID はプロファイルヘッダの MD5 エンコード値である。)
The source profile is a locally-stored profile. The syntax for <local-profile> is:
"local(" + <string> + ")"
where <string> is the profile's unique ID as specified by International Color Consortium. (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.)
<uri>
ソースプロファイルはカラープロファイルへの URI 参照
The source profile is a URI reference to a color profile.
(<local-profile> <uri>)
2つのプロファイルが指定される。<local-profile> がシステムに見つからない場合に <uri> が用いられる。
Two profiles are specified. If <local-profile> cannot be found on the local system, then the <uri> is used.
'name' (記述子)
値: <name>
初期値: 未定義
メディア: 視覚
Values: <name>
Initial: undefined
Media: visual
<name>
'color-profile' 要素の name 属性についての記述を見よ。注意:<name> が与えられていない場合、@color-profile 定義への参照ができなくなる。
See the description for the name attribute on the 'color-profile' element. Note that if <name> is not provided, it will be impossible to reference the given @color-profile definition.
'rendering-intent' (記述子)
値: auto | perceptual | relative-colorimetric |
saturation | absolute-colorimetric
初期値: auto
メディア: 視覚
アニメーション   不可
Values: auto | perceptual | relative-colorimetric |
saturation | absolute-colorimetric
Initial: auto
Media: visual
Animatable:   no

'color-profile' 要素の rendering-intent 属性についての記述を見よ。

See the description for the rendering-intent attribute on the 'color-profile' element.


12.3.5 'color-profile' プロパティ

 

 

'color-profile'
値:   auto | sRGB | <name> | <uri> | inherit
初期値:   auto
適用対象:   ラスター画像を参照する 'image' 要素
継承:   有り
パーセント:   N/A
メディア:   視覚
アニメーション   yes
Value:   auto | sRGB | <name> | <uri> | inherit
Initial:   auto
Applies to:   'image' elements that refer to raster images
Inherited:   yes
Percentages:   N/A
Media:   visual
Animatable:   yes
auto
これが既定の振る舞いである。内容データにより、自身に埋め込まれたより精密なプロファイルが指定されていない限り、全ての色は sRGB 色空間に属するものとみなされる。データ内にプロファイルが埋め込まれた画像ではそのプロファイルが利用される。プロファイルを持たない画像に対しては sRGB プロファイルが利用される。
This is the default behavior. All colors are presumed to be defined in the sRGB color space unless a more precise embedded profile is specified within content data. For images that do have a profile built into their data, that profile is used. For images that do not have a profile, the sRGB profile is used.
sRGB
ソースプロファイルは sRGB とみなされる。 auto との違いは、画像内に埋め込まれたプロファイルを上書きすることである。

CSS 字句走査解析規則 との整合性においては、キーワード "sRGB" の文字の大小は区別されない。しかしながら、業界慣行との整合性を保つにはこの大文字混じりの "sRGB" の使用が推奨される。
The source profile is assumed to be sRGB. This differs from auto in that it overrides an embedded profile inside an image.

For consistency with CSS lexical scanning and parsing rules, the keyword "sRGB" is case-insensitive; however, it is recommended that the mixed capitalization "sRGB" be used for consistency with common industry practice.
<name>
UAのカラープロファイル記述データベースに存在する定義済みのカラープロファイルに対応する名前。UAはカラープロファイル記述データベースの中から名前記述子が <name> に一致する カラープロファイル記述 エントリを検索し、見つかったもののうち最後に一致したものを利用する。見つかった場合は画像内に埋め込まれたプロファイルを上書きし、見つからなかった場合は画像内に埋め込まれたプロファイルが利用される。
A name corresponding to a defined color profile that is in the user agent's color profile description database. The 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. If a match is found, the corresponding profile overrides an embedded profile inside an image. If no match is found, then the embedded profile inside the image is used.
<uri>
ソースカラープロファイルへの URI 参照 。参照されたカラープロファイルは画像内に埋め込まれたプロファイルを上書きする。
A URI reference to the source color profile. The referenced color profile overrides an embedded profile inside the image.

12.4 Color Profile モジュール

要素 属性 内容モデル
color-profile Core.attrib, XLink.attrib, local, name, rendering-intent (Description.class)*

12.4.1 Color Profile 内容セット

Color Profile モジュールは ColorProfileElements 内容セットを定義する。

内容セット名 内容セットに含まれる要素
ColorProfileElements color-profile
 

12.5 DOM インターフェース

次に挙げるインターフェースが以下で定義される: SVGColorProfileElement, SVGColorProfileRule


インターフェース SVGColorProfileElement

SVGColorProfileElement インターフェースは 'color-profile' 要素に対応する。


IDL 定義
エラータ :次を修正。これに伴い、 IDL 定義 の該当部分も修正。)
interface SVGColorProfileElement : 
                SVGElement,
                SVGURIReference,
                SVGRenderingIntent { 
           attribute DOMString      _local;
           attribute DOMString      local;
                       // raises DOMException on setting
                       // (NOTE: attribute is prefixed by "_"
                       // as "local" is an IDL keyword. The
                       // prefix will be removed upon processing)
           attribute DOMString      name;
                       // raises DOMException on setting
           attribute unsigned short renderingIntent;
                       // raises DOMException on setting
};

属性
DOMString local
与えられた要素の local 属性に対応する。
設定時の例外
DOMException
NO_MODIFICATION_ALLOWED_ERR :読み出し専用の属性値の変更を試みたときにレイズされる。
DOMString name
与えられた要素の name 属性に対応する。
設定時の例外
DOMException
NO_MODIFICATION_ALLOWED_ERR :読み出し専用の属性値の変更を試みたときにレイズされる。
unsigned short renderingIntent
与えられた要素の rendering-intent 属性に対応する。描画インテントのタイプ。 SVGRenderingIntent で定義されている定数のいずれか。
設定時の例外
DOMException
NO_MODIFICATION_ALLOWED_ERR :読み出し専用の属性値の変更を試みたときにレイズされる。

インターフェース SVGColorProfileRule

SVGColorProfileRule インターフェースは CSS スタイルシートにおける @color-profile 規則を表現する。@color-profile 規則は文書から参照可能な ICC プロファイルを識別する。

SVGColorProfileRule インターフェースのサポートは CSS によるスタイル付け をサポートするUAにのみ要求される。


IDL 定義
interface SVGColorProfileRule : 
                SVGCSSRule,
                SVGRenderingIntent { 
           attribute DOMString      src;
                       // raises DOMException on setting
           attribute DOMString      name;
                       // raises DOMException on setting
           attribute unsigned short renderingIntent;
                       // raises DOMException on setting
};

属性
DOMString src
@color-profile 規則の src プロパティに対応する。
設定時の例外
DOMException
NO_MODIFICATION_ALLOWED_ERR :読み出し専用の属性値の変更を試みたときにレイズされる。
DOMString name
@color-profile 規則の name プロパティに対応する。
設定時の例外
DOMException
NO_MODIFICATION_ALLOWED_ERR :読み出し専用の属性値の変更を試みたときにレイズされる。
unsigned short renderingIntent
描画インテントのタイプ。 SVGRenderingIntent で定義されている定数のいずれか。
設定時の例外
DOMException
NO_MODIFICATION_ALLOWED_ERR :読み出し専用の属性値の変更を試みたときにレイズされる。