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

13 グラデーションとパターン


目次


 

13.1 概要

SVG においては、図形とテキストに対し、次のいずれかを用いてフィル(即ち内部への塗り)およびストローク(即ち外形線への塗り)を適用することができる:

With SVG, you can fill (i.e., paint the interior) or stroke (i.e., paint the outline) of shapes and text using one of the following:

SVG ペイントサーバ という考え方を用いる。 グラデーションとパターンは組み込みのペイントサーバの一種に過ぎない。 'solidColor' 要素はまた別の組み込みのペイントサーバであり、 で述べられている。 エラータ :原文の "solid color" はこの仕様には存在しない旧草案の名残。 変更履歴 も参照。)

SVG uses the general notion of a paint server. Gradients and patterns are just specific types of built-in paint servers. The 'solidColor' element is another built-in paint server, described in Color.

ペイントサーバは 'fill' あるいは 'stroke' プロパティの URI 参照 により参照される。

Paint servers are referenced using a URI reference on a 'fill' or 'stroke' property.

13.2 グラデーション

13.2.1 グラデーションの概要

グラデーションとはベクトルに沿った色から色への連続的な滑らかな色の変化である。同じベクトルに沿って更に別の色へと変化させることも可能である。 SVG は2種類のグラデーション 線型グラデーション ( linear gradients )と 放射型グラデーション ( radial gradients )を提供する。

Gradients consist of continuously smooth color transitions along a vector from one color to another, possibly followed by additional transitions along the same vector to other colors. SVG provides for two types of gradients, linear gradients and radial gradients.

いったんグラデーションが定義されれば、 グラフィックス要素'fill' あるいは 'stroke' プロパティからの参照により、その要素のフィルおよびストロークにグラデーションを用いることが可能になる。

Once defined, gradients are then referenced using 'fill' or 'stroke' properties on a given graphics element to indicate that the given element shall be filled or stroked with the referenced gradient.

13.2.2 線型グラデーション

線型グラデーションは 'linearGradient' 要素で定義される。
 

Linear gradients are defined by a 'linearGradient' element.
 

<!ENTITY % SVG.linearGradient.extra.content "" >
<!ENTITY % SVG.linearGradient.element "INCLUDE" >
<![%SVG.linearGradient.element;[
<!ENTITY % SVG.linearGradient.content
    "(( %SVG.Description.class; )*, ( %SVG.stop.qname; | %SVG.animate.qname;
      | %SVG.set.qname; | %SVG.animateTransform.qname;
        %SVG.linearGradient.extra.content; )*)"
>
<!ELEMENT %SVG.linearGradient.qname; %SVG.linearG\
radient.content; >
<!-- end of SVG.linearGradient.element -->]]>
<!ENTITY % SVG.linearGradient.attlist "INCLUDE" >
<![%SVG.linearGradient.attlist;[
<!ATTLIST %SVG.linearGradient.qname;
    %SVG.Core.attrib;
    %SVG.Style.attrib;
    %SVG.Color.attrib;
    %SVG.Gradient.attrib;
    %SVG.XLink.attrib;
    %SVG.External.attrib;
    x1 %Coordinate.datatype; #IMPLIED
    y1 %Coordinate.datatype; #IMPLIED
    x2 %Coordinate.datatype; #IMPLIED
    y2 %Coordinate.datatype; #IMPLIED
    gradientUnits ( userSpaceOnUse | objectBoundingBox ) #IMPLIED
    gradientTransform %TransformList.datatype; #IMPLIED
    spreadMethod ( pad | reflect | repeat ) #IMPLIED
>

属性定義:

gradientUnits = "userSpaceOnUse | objectBoundingBox"
属性 x1, y1, x2, y2 に対する座標系を定義する。
gradientUnits="userSpaceOnUse" の場合 x1, y1, x2, y2 はグラデーション要素が参照された時点における現在の利用座標系(即ち 'fill' あるいは 'stroke' プロパティによりグラデーション要素を参照している要素の利用座標系)に対し、 gradientTransform 属性で指定される変換を適用した結果の座標系における値を表す。
gradientUnits="objectBoundingBox" の場合、属性 x1, y1, x2, y2 の利用座標系は、グラデーションが適用される要素の包含ボックス( オブジェクトの包含ボックスに対して相対的な単位 を見よ)を基に gradientTransform 属性で指定される変換を適用して確立される。
gradientUnits="objectBoundingBox" の場合、 gradientTransform が単位行列であるならば、線型グラデーションの筋目はオブジェクトの包含ボックス空間(即ち (0,0) がオブジェクトの包含ボックスの左上隅、 (1,1) が右下隅に対応するような抽象的な座標系)においてはグラデーションベクトルに対し垂直になる。このとき、オブジェクトの包含ボックスが正方形でないならば、包含ボックス空間から利用空間への不均等な伸縮変換が適用されるので、この概念的な包含ボックス空間においてグラデーションベクトルに垂直な筋目は、利用空間においてはグラデーションベクトルに対し垂直にならない。
gradientUnits 属性が指定されていない場合の効果は、値 objectBoundingBox が指定されたときと同じになる。
アニメーション:可
Defines the coordinate system for attributes x1, y1, x2, y2.
If gradientUnits="userSpaceOnUse", x1, y1, x2, y2 represent values in the coordinate system that results from taking the current user coordinate system in place at the time when the gradient element is referenced (i.e., the user coordinate system for the element referencing the gradient element via a 'fill' or 'stroke' property) and then applying the transform specified by attribute gradientTransform.
If gradientUnits="objectBoundingBox", the user coordinate system for attributes x1, y1, x2, y2 is established using the bounding box of the element to which the gradient is applied (see Object bounding box units) and then applying the transform specified by attribute gradientTransform.
When gradientUnits="objectBoundingBox" and gradientTransform is the identity matrix, the stripes of the linear gradient are perpendicular to the gradient vector in object bounding box space (i.e., the abstract coordinate system where (0,0) is at the top/left of the object bounding box and (1,1) is at the bottom/right of the object bounding box). When the object's bounding box is not square, the stripes that are conceptually perpendicular to the gradient vector within object bounding box space will render non-perpendicular relative to the gradient vector in user space due to application of the non-uniform scaling transformation from bounding box space to user space.
If attribute gradientUnits is not specified, then the effect is as if a value of objectBoundingBox were specified.
Animatable: yes.
gradientTransform = "<transform-list>"
グラデーションの座標系から対象の座標系(即ち userSpaceOnUse あるいは objectBoundingBox )への追加の変換を定義する。これによりグラデーションを斜傾させたりすることができる。この追加の変換行列は、 オブジェクト包含ボックスに対し相対的な単位 から利用空間への変換に必要となる暗黙の変換も含めた、それまで定義された変換に対する後置積(即ち右からの積)をとる。
gradientTransform 属性が指定されていない場合の効果は、恒等変換が指定されたときと同じになる。
アニメーション:可
Contains the definition of an optional additional transformation from the gradient coordinate system onto the target coordinate system (i.e., userSpaceOnUse or objectBoundingBox). This allows for things such as skewing the gradient. This additional transformation matrix is post-multiplied to (i.e., inserted to the right of) any previously defined transformations, including the implicit transformation necessary to convert from object bounding box units to user space.
If attribute gradientTransform is not specified, then the effect is as if an identity transform were specified.
Animatable: yes.
x1 = "<coordinate>"
x1, y1, x2, y2 は、線型グラデーションに対する グラデーションベクトル を定義する。 グラデーションベクトルグラデーションストップ ( gradient stops )が写像される始点と終点を与える。 x1, y1, x2, y2 の値は数値でもパーセントでもよい。
この属性が指定されていない場合の効果は、値 "0%" が指定されたときと同じになる。
アニメーション:可
x1, y1, x2, y2 define a gradient vector for the linear gradient. This gradient vector provides starting and ending points onto which the gradient stops are mapped. The values of x1, y1, x2, y2 can be either numbers or percentages.
If the attribute is not specified, the effect is as if a value of "0%" were specified.
Animatable: yes.
y1 = "<coordinate>"
x1 を見よ。
この属性が指定されていない場合の効果は、値 "0%" が指定されたときと同じになる。
アニメーション:可
See x1.
If the attribute is not specified, the effect is as if a value of "0%" were specified.
Animatable: yes.
x2 = "<coordinate>"
x1 を見よ。
この属性が指定されていない場合の効果は、値 "100%" が指定されたときと同じになる。
アニメーション:可
See x1.
If the attribute is not specified, the effect is as if a value of "100%" were specified.
Animatable: yes.
y2 = "<coordinate>"
x1 を見よ。
この属性が指定されていない場合の効果は、値 "0%" が指定されたときと同じになる。
アニメーション:可
See x1.
If the attribute is not specified, the effect is as if a value of "0%" were specified.
Animatable: yes.
spreadMethod = "pad | reflect | repeat"
対象矩形の境界の内側でグラデーションが開始あるいは終了されるときに残りの領域をどのように塗るかを指定する。 値 pad の場合、グラデーションの両端の色で対象領域の残りの部分が塗り潰される。 値 reflect の場合、グラデーションパターンが開始-終止, 終止-開始, 開始-終止…等々と折り返されながら対象矩形が塗り潰されるまで延伸される。 値 repeat の場合、グラデーションパターンが開始-終止, 開始-終止, 開始-終止…等々と繰り返されながら対象矩形が塗り潰されるまで延伸される。
この属性が指定されていない場合の効果は、値 "pad" が指定されたときと同じになる。
アニメーション:可
Indicates what happens if the gradient starts or ends inside the bounds of the target rectangle. Possible values are: pad, which says to use the terminal colors of the gradient to fill the remainder of the target region, reflect, which says to reflect the gradient pattern start-to-end, end-to-start, start-to-end, etc. continuously until the target rectangle is filled, and repeat, which says to repeat the gradient pattern start-to-end, start-to-end, start-to-end, etc. continuously until the target region is filled.
If the attribute is not specified, the effect is as if a value of "pad" were specified.
Animatable: yes.
xlink:href = " <uri>"
現在の SVG 文書片内の異なる 'linearGradient' または 'radialGradient' 要素への URI 参照'linearGradient' の属性が参照先の要素で定義されていて、かつ、この要素には定義されていなければ、この要素に継承される。この要素にグラデーションストップが定義されておらず、かつ、参照先の要素には定義されている(それ自身の href 属性によるものも含める)ならば、グラデーションストップは参照先の要素からこの要素に継承される。この継承はいくらでも間接的になり得る。すなわち、参照先の要素が自身の href 属性により属性あるいはグラデーションストップを継承している場合、現在の要素もこれらの属性あるいはグラデーションストップを継承する。
アニメーション:可
A URI reference to a different 'linearGradient' or 'radialGradient' element within the current SVG document fragment. Any 'linearGradient' attributes which are defined on the referenced element which are not defined on this element are inherited by this element. If this element has no defined gradient stops, and the referenced element does (possibly due to its own href attribute), then this element inherits the gradient stop from the referenced element. Inheritance can be indirect to an arbitrary level; thus, if the referenced element inherits attribute or gradient stops due to its own href attribute, then the current element can inherit those attributes or gradient stops.
Animatable: yes.

パーセントを x1, y1, x2, y2 に指定しても良い。 gradientUnits="userSpaceOnUse" の場合、パーセントは現在のビューポートに相対的な値を表す。 gradientUnits="objectBoundingBox" の場合、パーセントはオブジェクトの包含ボックスに相対的な値を表す。

Percentages are allowed for x1, y1, x2, y2. For gradientUnits="userSpaceOnUse", percentages represent values relative to the current viewport. For gradientUnits="objectBoundingBox", percentages represent values relative to the bounding box for the object.

x1 = x2, y1 = y2 の場合、最後の グラデーションストップ の色と不透明度を用いた単色で領域が塗られる。

If x1 = x2 and y1 = y2, then the area to be painted will be painted as a single color using the color and opacity of the last gradient stop.

プロパティ は祖先から 'linearGradient' 要素に継承されるが、 'linearGradient' 要素を参照する要素からは継承されない

Properties inherit into the 'linearGradient' element from its ancestors; properties do not inherit from the element referencing the 'linearGradient' element.

'linearGradient' 要素は決して直接描画されることはなく、 'fill' あるいは 'stroke' プロパティからの参照以外に使い道はない。 'display' プロパティは 'linearGradient' 要素に適用されない。すなわち、 'linearGradient' 要素は 'display' プロパティの値が none 以外であっても直接描画されることはなく、たとえ要素自身あるいはその祖先において 'display' プロパティの値が none であっても参照による利用が可能である。

'linearGradient' elements are never rendered directly; their only usage is as something that can be referenced using the 'fill' and 'stroke' properties. The 'display' property does not apply to the 'linearGradient' element; thus, 'linearGradient' elements are not directly rendered even if the 'display' property is set to a value other than none, and 'linearGradient' elements are available for referencing even when the 'display' property on the 'linearGradient' element or any of its ancestors is set to none.

Example lingrad01 に線型グラデーション・ペイントサーバの参照による矩形のフィルを示す。

Example lingrad01 shows how to fill a rectangle by referencing a linear gradient paint server.

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="8cm" height="4cm" viewBox="0 0 800 400"
     xmlns="http://www.w3.org/2000/svg" version="1.1">
  <desc>Example lingrad01 -
           線型グラデーション・ペイントサーバによる矩形のフィル</desc>
  <g>
    <defs>
      <linearGradient id="MyGradient">
        <stop offset="5%" stop-color="#F60" />
        <stop offset="95%" stop-color="#FF6" />
      </linearGradient>
    </defs>
    <!-- 描画領域の枠を青色にする -->
    <rect fill="none" stroke="blue" 
          x="1" y="1" width="798" height="398"/>
    <!-- 矩形の内部は線型グラデーション・ペイントサーバを用いて塗られる -->
    <rect fill="url(#MyGradient)" stroke="black" stroke-width="5"  
          x="100" y="100" width="600" height="200"/>
  </g>
</svg>
Example lingrad01
Example lingrad01 - fill a rectangle by referencing a linear gradient paint server

この例を SVG で見る( SVG 対応ブラウザのみ)
 

13.2.3 放射型グラデーション

放射型グラデーションは 'radialGradient' 要素により定義される。
 

Radial gradients are defined by a 'radialGradient' element.
 

<!ENTITY % SVG.radialGradient.extra.content "" >
<!ENTITY % SVG.radialGradient.element "INCLUDE" >
<![%SVG.radialGradient.element;[
<!ENTITY % SVG.radialGradient.content
    "(( %SVG.Description.class; )*, ( %SVG.stop.qname; | %SVG.animate.qname;
      | %SVG.set.qname; | %SVG.animateTransform.qname;
        %SVG.radialGradient.extra.content; )*)"
>
<!ELEMENT %SVG.radialGradient.qname; %SVG.radialG\
radient.content; >
<!-- end of SVG.radialGradient.element -->]]>
<!ENTITY % SVG.radialGradient.attlist "INCLUDE" >
<![%SVG.radialGradient.attlist;[
<!ATTLIST %SVG.radialGradient.qname;
    %SVG.Core.attrib;
    %SVG.Style.attrib;
    %SVG.Color.attrib;
    %SVG.Gradient.attrib;
    %SVG.XLink.attrib;
    %SVG.External.attrib;
    cx %Coordinate.datatype; #IMPLIED
    cy %Coordinate.datatype; #IMPLIED
    r %Length.datatype; #IMPLIED
    fx %Coordinate.datatype; #IMPLIED
    fy %Coordinate.datatype; #IMPLIED
    gradientUnits ( userSpaceOnUse | objectBoundingBox ) #IMPLIED
    gradientTransform %TransformList.datatype; #IMPLIED
    spreadMethod ( pad | reflect | repeat ) #IMPLIED
>

属性定義:

gradientUnits = "userSpaceOnUse | objectBoundingBox"
属性 cx, cy, r, fx, fy に対する座標系を定義する。
gradientUnits="userSpaceOnUse" の場合、 cx, cy, r, fx, fy は、グラデーション要素が参照された時点における現在の利用座標系(即ち 'fill' あるいは 'stroke' プロパティによりグラデーション要素を参照している要素の利用座標系)に対し、 gradientTransform 属性で指定される変換を適用した結果の座標系における値を表す。
gradientUnits="objectBoundingBox" の場合、 cx, cy, r, fx, fy 属性の利用座標系は、グラデーションが適用される要素の包含ボックス( オブジェクトの包含ボックスに対して相対的な単位 を見よ)を基に gradientTransform 属性で指定される変換を適用して確立される。
gradientUnits="objectBoundingBox" の場合、 gradientTransform が単位行列であるとすれば、放射型グラデーションの輪はオブジェクトの包含ボックス空間(即ち (0,0) がオブジェクトの包含ボックスの左上隅、(1,1) が右下隅となるような抽象的な座標系)において真円になる。オブジェクトの包含ボックスが正方形でないならば、包含ボックス空間から利用空間への不均等な伸縮変換が適用されるので、この概念的な包含ボックス空間において真円の輪は、利用空間においては楕円形になる。
gradientUnits 属性が指定されていない場合の効果は、値 objectBoundingBox が指定されたときと同じになる。
アニメーション:可
Defines the coordinate system for attributes cx, cy, r, fx, fy.
If gradientUnits="userSpaceOnUse", cx, cy, r, fx, fy represent values in the coordinate system that results from taking the current user coordinate system in place at the time when the gradient element is referenced (i.e., the user coordinate system for the element referencing the gradient element via a 'fill' or 'stroke' property) and then applying the transform specified by attribute gradientTransform.
If gradientUnits="objectBoundingBox", the user coordinate system for attributes cx, cy, r, fx, fy is established using the bounding box of the element to which the gradient is applied (see Object bounding box units) and then applying the transform specified by attribute gradientTransform.
When gradientUnits="objectBoundingBox" and gradientTransform is the identity matrix, then the rings of the radial gradient are circular with respect to the object bounding box space (i.e., the abstract coordinate system where (0,0) is at the top/left of the object bounding box and (1,1) is at the bottom/right of the object bounding box). When the object's bounding box is not square, the rings that are conceptually circular within object bounding box space will render as elliptical due to application of the non-uniform scaling transformation from bounding box space to user space.
If attribute gradientUnits is not specified, then the effect is as if a value of objectBoundingBox were specified.
Animatable: yes.
gradientTransform = " <transform-list>"
グラデーションの座標系から対象の座標系(即ち userSpaceOnUse あるいは objectBoundingBox )への追加的変換を定義する。これによりグラデーションを斜傾させたりすることができる。この追加の変換行列は、 オブジェクト包含ボックスに対し相対的な単位 から利用空間への変換に必要となる暗黙の変換も含めた、それまで定義された変換に対する後置積(即ち右からの積)をとる。
gradientTransform 属性が指定されていない場合の効果は、恒等変換が指定されたときと同じになる。
アニメーション:可
Contains the definitions of an optional additional transformation from the gradient coordinate system onto the target coordinate system (i.e., userSpaceOnUse or objectBoundingBox). This allows for things such as skewing the gradient. This additional transformation matrix is post-multiplied to (i.e., inserted to the right of) any previously defined transformations, including the implicit transformation necessary to convert from object bounding box units to user space.
If attribute gradientTransform is not specified, then the effect is as if an identity transform were specified.
Animatable: yes.
cx = "<coordinate>"
cx, cy, r は放射型グラデーションに対する最大の(即ち最外縁の)円を定義する。グラデーションは 100% の グラデーションストップ がこの最大の円の周上に写像されるように描かれる。
この属性が指定されていない場合の効果は、値 "50%" が指定されたときと同じになる。
アニメーション:可
cx, cy, r define the largest (i.e., outermost) circle for the radial gradient. The gradient will be drawn such that the 100% gradient stop is mapped to the perimeter of this largest (i.e., outermost) circle.
If the attribute is not specified, the effect is as if a value of "50%" were specified.
Animatable: yes.
cy = " <coordinate>"
cx を見よ。
この属性が指定されていない場合の効果は、値 "50%" が指定されたときと同じになる。
アニメーション:可
See cx.
If the attribute is not specified, the effect is as if a value of "50%" were specified.
Animatable: yes.
r = " <length>"
cx を見よ。
負値はエラー( エラー処理 を見よ)。 値を0にすると最後の グラデーションストップ の色と不透明度を用いた単色で領域が塗られる。
この属性が指定されていない場合の効果は、値 "50%" が指定されたときと同じになる。
アニメーション:可
See cx.
A negative value is an error (see Error processing). A value of zero will cause the area to be painted as a single color using the color and opacity of the last gradient stop.
If the attribute is not specified, the effect is as if a value of "50%" were specified.
Animatable: yes.
fx = " <coordinate>"
fx, fy は放射型グラデーションの焦点( focal point )を定義する。 グラデーションは 0% の グラデーションストップ が (fx, fy) に写像されるように描かれる
fx 属性が指定されていない場合、 cx に一致するものと見なされる。
アニメーション:可
fx, fy define the focal point for the radial gradient. The gradient will be drawn such that the 0% gradient stop is mapped to (fx, fy).
If attribute fx is not specified, fx will coincide with cx.
Animatable: yes.
fy = " <coordinate>"
fx を見よ。
fy 属性が指定されていない場合、 cy に一致するものと見なされる。
アニメーション:可
See fx.
If attribute fy is not specified, fy will coincide with cy.
Animatable: yes.
spreadMethod = "pad | reflect | repeat"
オブジェクトの境界の内側でグラデーションが開始あるいは終了されるときに残りの領域をどのように塗るかを指定する。 'linearGradient' 要素の spreadMethod 属性と同じ値をとれ、同じ意味を持つ。
アニメーション:可
Indicates what happens if the gradient starts or ends inside the bounds of the object(s) being painted by the gradient. Has the same values and meanings as the spreadMethod attribute on 'linearGradient' element.
Animatable: yes.
xlink:href = "<uri>"
現在の SVG 文書片内の異なる 'linearGradient' または 'radialGradient' 要素への URI 参照'radialGradient' の属性が参照先の要素で定義されていて、かつ、この要素には定義されていなければ、この要素に継承される。この要素にグラデーションストップが定義されておらず、かつ、参照先の要素には定義されている(それ自身の href 属性によるものも含める)ならば、グラデーションストップは参照先の要素からこの要素に継承される。継承はいくらでも間接的になり得る。すなわち、参照先の要素が自身の href 属性によって属性あるいはグラデーションストップを継承した場合、現在の要素もこれらの属性あるいはグラデーションストップを継承する。
アニメーション:可
A URI reference to a different 'linearGradient' or 'radialGradient' element within the current SVG document fragment. Any 'radialGradient' attributes which are defined on the referenced element which are not defined on this element are inherited by this element. If this element has no defined gradient stops, and the referenced element does (possibly due to its own href attribute), then this element inherits the gradient stop from the referenced element. Inheritance can be indirect to an arbitrary level; thus, if the referenced element inherits attribute or gradient stops due to its own href attribute, then the current element can inherit those attributes or gradient stops.
Animatable: yes.

パーセントを cx, cy, r, fx, fy に指定しても良い。 gradientUnits="userSpaceOnUse" の場合、パーセントは現在のビューポートに相対的な値を表す。 gradientUnits="objectBoundingBox" の場合、パーセントはオブジェクトの包含ボックスに相対的な値を表す。

Percentages are allowed for attributes cx, cy, r, fx and fy. For gradientUnits="userSpaceOnUse", percentages represent values relative to the current viewport. For gradientUnits="objectBoundingBox", percentages represent values relative to the bounding box for the object.

もし fx, fy で定義される焦点が cx, cy, r で定義される円の外側にある場合、UAは焦点を (cx, cy) から (fx, fy) への直線と cx, cy, r で定義される円の交点に設定するものとする。

If the point defined by fx and fy lies outside the circle defined by cx, cy and r, then the user agent shall set the focal point to the intersection of the line from ( cx, cy) to ( fx, fy) with the circle defined by cx, cy and r.

プロパティ は祖先から 'radialGradient' 要素に継承されるが、 'radialGradient' 要素を参照する要素からは継承されない

Properties inherit into the 'radialGradient' element from its ancestors; properties do not inherit from the element referencing the 'radialGradient' element.

'radialGradient' 要素は決して直接描画されることはなく、 'fill' あるいは 'stroke' プロパティからの参照以外の使い方はない。 'display' プロパティは 'radialGradient' 要素に適用されない。すなわち、 'radialGradient' 要素は 'display' プロパティの値が none 以外であっても直接描画されることはなく、 'radialGradient' 要素あるいはその祖先において 'display' プロパティが none に設定されていても 'radialGradient' 要素を参照して利用することができる。

'radialGradient' elements are never rendered directly; their only usage is as something that can be referenced using the 'fill' and 'stroke' properties. The 'display' property does not apply to the 'radialGradient' element; thus, 'radialGradient' elements are not directly rendered even if the 'display' property is set to a value other than none, and 'radialGradient' elements are available for referencing even when the 'display' property on the 'radialGradient' element or any of its ancestors is set to none.

Example radgrad01 に線型グラデーション・ペイントサーバの参照による矩形のフィルを示す。

Example radgrad01 shows how to fill a rectangle by referencing a radial gradient paint server.

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="8cm" height="4cm" viewBox="0 0 800 400"
     xmlns="http://www.w3.org/2000/svg" version="1.1">
  <desc>Example radgrad01 - 
           放射型グラデーション・ペイントサーバによる矩形のフィル</desc>
  <g>
    <defs>
      <radialGradient id="MyGradient" gradientUnits="userSpaceOnUse"
                      cx="400" cy="200" r="300" fx="400" fy="200">
        <stop offset="0%" stop-color="red" />
        <stop offset="50%" stop-color="blue" />
        <stop offset="100%" stop-color="red" />
      </radialGradient>
    </defs>
    <!-- 描画領域の枠を青色にする -->
    <rect fill="none" stroke="blue" 
          x="1" y="1" width="798" height="398"/>
    <!-- 矩形の内部は放射型グラデーション・ペイントサーバを用いて塗られる -->
    <rect fill="url(#MyGradient)" stroke="black" stroke-width="5"  
          x="100" y="100" width="600" height="200"/>
  </g>
</svg>
Example radgrad01
Example radgrad01 - fill a rectangle by referencing a radial gradient paint server

この例を SVG で見る( SVG 対応ブラウザのみ)
 

13.2.4 グラデーションストップ

グラデーションで利用される色の勾配は 'linearGradient' 要素あるいは 'radialGradient' 要素の子要素となる 'stop' 要素で定義される。

The ramp of colors to use on a gradient is defined by the 'stop' elements that are child elements to either the 'linearGradient' element or the 'radialGradient' element.

<!ENTITY % SVG.stop.extra.content "" >
<!ENTITY % SVG.stop.element "INCLUDE" >
<![%SVG.stop.element;[
<!ENTITY % SVG.stop.content
    "( %SVG.animate.qname; | %SVG.set.qname; | %SVG.animateColor.qname;
       %SVG.stop.extra.content; )*"
>
<!ELEMENT %SVG.stop.qname; %SVG.stop.content; >
<!-- end of SVG.stop.element -->]]>
<!ENTITY % SVG.stop.attlist "INCLUDE" >
<![%SVG.stop.attlist;[
<!ATTLIST %SVG.stop.qname;
    %SVG.Core.attrib;
    %SVG.Style.attrib;
    %SVG.Color.attrib;
    %SVG.Gradient.attrib;
    offset %NumberOrPercentage.datatype; #REQUIRED
>

属性定義:

offset = " <number> | <percentage>"
offset 属性の値は <number> (通常は0から1までの範囲)または <percentage> (通常は 0% から 100% までの範囲)をとり、グラデーションストップの位置を指示する。線型グラデーションにおける offset 属性は グラデーションベクトル に沿った地点を表す。放射型グラデーションにおいては、(fx,fy) から最大/最外円までの距離に対する比率を表す。
アニメーション:可
The offset attribute is either a <number> (usually ranging from 0 to 1) or a <percentage> (usually ranging from 0% to 100%) which indicates where the gradient stop is placed. For linear gradients, the offset attribute represents a location along the gradient vector. For radial gradients, it represents a percentage distance from (fx,fy) to the edge of the outermost/largest circle.
Animatable: yes.

'stop-color' プロパティはグラデーションストップにおいて利用される色を指示する。 'fill' および 'stroke' プロパティにおける <paint> の指定と同様、キーワード currentColor と ICC カラーを指定することができる。

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> specification for the 'fill' and 'stroke' properties.

'stop-color'
値:   currentColor |
<color> [icc-color(<name>[,<icccolorvalue>]*)] |
inherit
初期値:   black
適用対象:   'stop' 要素
継承:   無し
Percentages:   N/A
メディア:   視覚
アニメーション:   :可
Value:   currentColor |
<color> [icc-color(<name>[,<icccolorvalue>]*)] |
inherit
Initial:   black
Applies to:   'stop' elements
Inherited:   no
Percentages:   N/A
Media:   visual
Animatable:   yes

'stop-opacity' プロパティはグラデーションストップにおける不透明度を定義する。

The 'stop-opacity' property defines the opacity of a given gradient stop.

'stop-opacity'
値:   <opacity-value> | inherit
初期値:   1
適用対象:   'stop' 要素
継承:   無し
Percentages:   N/A
メディア:   視覚
アニメーション   :可
Value:   <opacity-value> | inherit
Initial:   1
Applies to:   'stop' elements
Inherited:   no
Percentages:   N/A
Media:   visual
Animatable:   yes

グラデーションにおけるいくつかの注意:

Some notes on gradients:

13.3 パターン

パターンは、あらかじめ定義されたグラフィックオブジェクトによるオブジェクトのフィルおよびストロークに利用され、塗り領域を覆うために一定の間隔 x, y で繰り返すことができる(「敷詰められる」)。 パターンは 'pattern' 要素で定義される。パターンを グラフィックス要素 のフィルあるいはストロークに用いることを指示するには、その 'fill' あるいは 'stroke' プロパティから 'pattern' 要素を参照する。

A pattern is used to fill or stroke an object using a pre-defined graphic object which can be replicated ("tiled") at fixed intervals in x and y to cover the areas to be painted. Patterns are defined using a 'pattern' element and then referenced by properties 'fill' and 'stroke' on a given graphics element to indicate that the given element shall be filled or stroked with the referenced pattern.

属性 x, y, width, height, patternUnits は無限に拡がるキャンバス上に基準となる矩形を定義する。基準矩形の左上は (x, y) に、右下は (x + width, y + height) に位置する。敷詰めは理論上、整数 m, n に対する座標 (x + m* widthy  + n* height) を開始位置とする基準矩形の連続を、全ての整数 m, n に渡りX軸Y軸両方向(正負両方)に無限に拡げることである。

Attributes x, y, width, height and patternUnits define a reference rectangle somewhere on the infinite canvas. The reference rectangle has its top/left at ( x, y) and its bottom/right at ( x+ width, y+ height). The tiling theoretically extends a series of such rectangles to infinity in X and Y (positive and negative), with rectangles starting at ( x + m* widthy + n* height) for each possible integer value for m and n.

<!ENTITY % SVG.pattern.extra.content "" >
<!ENTITY % SVG.pattern.element "INCLUDE" >
<![%SVG.pattern.element;[
<!ENTITY % SVG.pattern.content
    "( %SVG.Description.class; | %SVG.Animation.class; %SVG.Structure.class;
       %SVG.Conditional.class; %SVG.Image.class; %SVG.Style.class;
       %SVG.Shape.class; %SVG.Text.class; %SVG.Marker.class;
       %SVG.ColorProfile.class; %SVG.Gradient.class; %SVG.Pattern.class;
       %SVG.Clip.class; %SVG.Mask.class; %SVG.Filter.class; %SVG.Cursor.class;
       %SVG.Hyperlink.class; %SVG.View.class; %SVG.Script.class;
       %SVG.Font.class; %SVG.Extensibility.class; %SVG.pattern.extra.content; )*"
>
<!ELEMENT %SVG.pattern.qname; %SVG.pattern.content; >
<!-- end of SVG.pattern.element -->]]>
<!ENTITY % SVG.pattern.attlist "INCLUDE" >
<![%SVG.pattern.attlist;[
<!ATTLIST %SVG.pattern.qname;
    %SVG.Core.attrib;
    %SVG.Conditional.attrib;
    %SVG.Style.attrib;
    %SVG.Presentation.attrib;
    %SVG.XLink.attrib;
    %SVG.External.attrib;
    x %Coordinate.datatype; #IMPLIED
    y %Coordinate.datatype; #IMPLIED
    width %Length.datatype; #IMPLIED
    height %Length.datatype; #IMPLIED
    patternUnits ( userSpaceOnUse | objectBoundingBox ) #IMPLIED
    patternContentUnits ( userSpaceOnUse | objectBoundingBox ) #IMPLIED
    patternTransform %TransformList.datatype; #IMPLIED
    viewBox %ViewBoxSpec.datatype; #IMPLIED
    preserveAspectRatio %PreserveAspectRatioSpec.datatype; 'xMidYMid meet'
>

属性定義:

patternUnits = "userSpaceOnUse | objectBoundingBox"
属性 x, y, width, height の座標系を定義する。
patternUnits="userSpaceOnUse" の場合、 x, y, width, height は、 'pattern' 要素が参照された時点における現在の利用座標系(即ち 'fill' あるいは 'stroke' プロパティにより 'pattern' 要素を参照している要素の利用座標系)に対し、 patternTransform 属性で指定される変換を適用した結果の座標系の値を表す。
patternUnits="objectBoundingBox" の場合、 x, y, width, height の利用座標系は、パターンが適用される要素の包含ボックス( オブジェクトの包含ボックスに対して相対的な単位 を見よ)を基に、 patternTransform 属性で指定される変換を適用して確立される。
patternUnits 属性が指定されていない場合の効果は、値 objectBoundingBox が指定されたときと同じになる。
アニメーション:可
Defines the coordinate system for attributes x, y, width, height.
If patternUnits="userSpaceOnUse", x, y, width, height represent values in the coordinate system that results from taking the current user coordinate system in place at the time when the 'pattern' element is referenced (i.e., the user coordinate system for the element referencing the 'pattern' element via a 'fill' or 'stroke' property) and then applying the transform specified by attribute patternTransform.
If patternUnits="objectBoundingBox", the user coordinate system for attributes x, y, width, height is established using the bounding box of the element to which the pattern is applied (see Object bounding box units) and then applying the transform specified by attribute patternTransform.
If attribute patternUnits is not specified, then the effect is as if a value of objectBoundingBox were specified.
Animatable: yes.
patternContentUnits = "userSpaceOnUse | objectBoundingBox"
'pattern' の内容に対する座標系を定義する。 viewBox 属性が指定されている場合、この属性は何の効果も生じさせないことに注意。
patternContentUnits="userSpaceOnUse" の場合、 'pattern' 要素の内容に対する利用座標系は、 'pattern' 要素が参照された時点における現在の利用座標系(即ち 'fill' あるいは 'stroke' プロパティにより 'pattern' 要素を参照している要素の利用座標系)に対し、 patternTransform 属性で指定される変換を適用した結果になる。
patternContentUnits="objectBoundingBox" の場合、 'pattern' 要素の内容に対する利用座標系は、パターンが適用される要素の包含ボックス( オブジェクトの包含ボックスに対して相対的な単位 を見よ)を基に patternTransform 属性で指定される変換を適用して確立される。
patternContentUnits 属性が指定されていない場合の効果は、値 userSpaceOnUse が指定されたときと同じになる。
アニメーション:可
Defines the coordinate system for the contents of the 'pattern'. Note that this attribute has no effect if attribute viewBox is specified.
If patternContentUnits="userSpaceOnUse", the user coordinate system for the contents of the 'pattern' element is the coordinate system that results from taking the current user coordinate system in place at the time when the 'pattern' element is referenced (i.e., the user coordinate system for the element referencing the 'pattern' element via a 'fill' or 'stroke' property) and then applying the transform specified by attribute patternTransform.
If patternContentUnits="objectBoundingBox", the user coordinate system for the contents of the 'pattern' element is established using the bounding box of the element to which the pattern is applied (see Object bounding box units) and then applying the transform specified by attribute patternTransform.
If attribute patternContentUnits is not specified, then the effect is as if a value of userSpaceOnUse were specified.
Animatable: yes.
patternTransform = "<transform-list>"
パターンの座標系から対象の座標系(即ち userSpaceOnUse あるいは objectBoundingBox )への追加の変換を定義する。これによりパターンを斜傾させたりすることができる。この追加の変換行列は、 オブジェクト包含ボックスに対し相対的な単位 から利用空間への変換に必要となる暗黙の変換も含めた、それまで定義された変換に対する後置積(即ち右からの積)をとる。
patternTransform 属性が指定されていない場合の効果は、恒等変換が指定されたときと同じになる。
アニメーション:可
Contains the definition of an optional additional transformation from the pattern coordinate system onto the target coordinate system (i.e., userSpaceOnUse or objectBoundingBox). This allows for things such as skewing the pattern tiles. This additional transformation matrix is post-multiplied to (i.e., inserted to the right of) any previously defined transformations, including the implicit transformation necessary to convert from object bounding box units to user space.
If attribute patternTransform is not specified, then the effect is as if an identity transform were specified.
Animatable: yes.
x = "<coordinate>"
x, y, width, height は、パターンがどのように位置し、空間を占めるかを指示する。これらの属性は patternUnits 属性と patternTransform 属性の組み合わせにより指定される座標空間の値を表す。
この属性が指定されていない場合の効果は、値 "0" が指定されたときと同じになる。
アニメーション:可
x, y, width, height indicate how the pattern tiles are placed and spaced. These attributes represent coordinates and values in the coordinate space specified by the combination of attributes patternUnits and patternTransform.
If the attribute is not specified, the effect is as if a value of zero were specified.
Animatable: yes.
y = "<coordinate>"
x を見よ。
この属性が指定されていない場合の効果は、値 "0" が指定されたときと同じになる。
アニメーション:可
See x.
If the attribute is not specified, the effect is as if a value of zero were specified.
Animatable: yes.
width = "<length>"
x を見よ。
負値はエラー( エラー処理 を見よ)。 値を0にすると要素は描画されなくなる(即ちどのような塗りも適用されない)。
この属性が指定されていない場合の効果は、値 "0" が指定されたときと同じになる。
アニメーション:可
See x.
A negative value is an error (see Error processing). A value of zero disables rendering of the element (i.e., no paint is applied).
If the attribute is not specified, the effect is as if a value of zero were specified.
Animatable: yes.
height = " <length>"
x を見よ。
負値はエラー( エラー処理 を見よ)。 値を0にすると要素は描画されなくなる(即ちどのような塗りも適用されない)。
この属性が指定されていない場合の効果は、値 "0" が指定されたときと同じになる。
アニメーション:可
See x.
A negative value is an error (see Error processing). A value of zero disables rendering of the element (i.e., no paint is applied).
If the attribute is not specified, the effect is as if a value of zero were specified.
Animatable: yes.
xlink:href = " <uri>"
現在の SVG 文書片内の異なる 'pattern' 要素への URI 参照 。参照先の要素で定義されている属性のうちこの要素で定義されていないものは、この要素に継承される。この要素が子要素を含んでおらず、参照先の要素は含んでいる(それ自身の href 属性によるものも含める)場合、この要素は参照先の要素の子要素を継承する。継承はいくらでも間接的になり得る。参照先の要素が自身の href 属性によって属性あるいは子要素を継承した場合、現在の要素もこれらの属性あるいは子要素を継承する。
アニメーション:可
A URI reference to a different 'pattern' element within the current SVG document fragment. Any attributes which are defined on the referenced element which are not defined on this element are inherited by this element. If this element has no children, and the referenced element does (possibly due to its own href attribute), then this element inherits the children from the referenced element. Inheritance can be indirect to an arbitrary level; thus, if the referenced element inherits attributes or children due to its own href attribute, then the current element can inherit those attributes or children.
Animatable: yes.

SVG の UAスタイルシート においては 'pattern' 要素に対する 'overflow' プロパティは hidden に設定されているので、パターンタイルの境界に矩形のクリッピングパスが作成される。 'overflow' プロパティが上書きされない限り、パターンの矩形の外側にはみ出るパターンのグラフィックは切り取られる。 エラータ :次を挿入) 'overflow' プロパティが visible に設定されている場合のパターンの描画のふるまいは未定義であることに注意。 下の Example pattern01 にパターンタイルのクリッピングによる効果を示す。

SVG's user agent style sheet sets the 'overflow' property for 'pattern' elements to hidden, which causes a rectangular clipping path to be created at the bounds of the pattern tile. Unless the 'overflow' property is overridden, any graphics within the pattern which goes outside of the pattern rectangle will be clipped. Example pattern01 below shows the effect of clipping to the pattern tile.

'pattern' の内容は新しい座標系に相対的である。 viewBox 属性がある場合、新しい座標系は viewBoxpreserveAspectRatio による標準の規則を用いて 'pattern' 要素の x, y, width, height, patternUnits 属性により定義される領域にはめ込まれる。 viewBox 属性が無い場合、新しい座標系はその原点を 'pattern' 要素の x,y 属性で確立される座標 (x,y) にとる。したがって、次の例:

The contents of the 'pattern' are relative to a new coordinate system. If there is a viewBox attribute, then the new coordinate system is fitted into the region defined by the x, y, width, height and patternUnits attributes on the 'pattern' element using the standard rules for viewBox and preserveAspectRatio. If there is no viewBox attribute, then the new coordinate system has its origin at (x,y), where x is established by the x attribute on the 'pattern' element, and y is established by the y attribute on the 'pattern' element. Thus, in the following example:

<pattern x="10" y="10" width="20" height="20">
   <rect x="5" y="5" width="10" height="10"/>
</pattern>

では、矩形はその左上がパターンタイルの原点から右へ5単位, 下へ5単位ずれたところに位置する。

the rectangle has its top/left located 5 units to the right and 5 units down from the origin of the pattern tile.

viewBox 属性により、 x, y, width, height, patternUnits 属性による新しいパターン座標系の上に適用される追加の変換がもたらされる。

The viewBox attribute introduces a supplemental transformation which is applied on top of any transformations necessary to create a new pattern coordinate system due to attributes x, y, width, height and patternUnits.

プロパティ は祖先から 'pattern' 要素に継承されるが、 'pattern' 要素を参照する要素からは継承されない

Properties inherit into the 'pattern' element from its ancestors; properties do not inherit from the element referencing the 'pattern' element.

'pattern' 要素は決して直接描画されることはなく、 'fill' あるいは 'stroke' プロパティからの参照以外の使い方はない。 'display' プロパティは 'radialGradient' 要素に適用されない。すなわち、 'pattern' 要素は 'display' プロパティの値が none 以外であっても直接描画されることはなく、 'pattern' 要素あるいはその祖先において 'display' プロパティが none に設定されていても 'pattern' 要素を参照して利用することができる。

'pattern' elements are never rendered directly; their only usage is as something that can be referenced using the 'fill' and 'stroke' properties. The 'display' property does not apply to the 'pattern' element; thus, 'pattern' elements are not directly rendered even if the 'display' property is set to a value other than none, and 'pattern' elements are available for referencing even when the 'display' property on the 'pattern' element or any of its ancestors is set to none.

'pattern' 要素の内容に付加された イベント属性イベントリスナ は処理されない。 'pattern' 要素においては描画に関する部分のみが処理される。

Event attributes and event listeners attached to the contents of a 'pattern' element are not processed; only the rendering aspects of 'pattern' elements are processed.

Example pattern01 にパターン・ペイントサーバへの参照を用いた矩形のフィルを示す。各三角形に対する青色のストロークにおいてその上端と左端部分が切り取られていることに注意。 これは SVG の UAスタイルシート において 'pattern' 要素の 'overflow' プロパティが hidden に設定されていることにより、パターンタイルの境界でパターンが切り取られているからである。

Example pattern01 shows how to fill a rectangle by referencing a pattern paint server. Note how the blue stroke of each triangle has been clipped at the top and the left. This is due to SVG's user agent style sheet setting the 'overflow' property for 'pattern' elements to hidden, which causes the pattern to be clipped to the bounds of the pattern tile.

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="8cm" height="4cm" viewBox="0 0 800 400"
     xmlns="http://www.w3.org/2000/svg" version="1.1">
  <defs>
    <pattern id="TrianglePattern" patternUnits="userSpaceOnUse"
             x="0" y="0" width="100" height="100"
             viewBox="0 0 10 10" >
      <path d="M 0 0 L 7 0 L 3.5 7 z" fill="red" stroke="blue" />
    </pattern> 
  </defs>
    <!-- 描画領域の枠を青色にする -->
  <rect fill="none" stroke="blue" 
        x="1" y="1" width="798" height="398"/>
  <!-- 楕円の内部は三角形のパターン・ペイントサーバを用いて塗られ、
       外形線は黒色に塗られる-->
  <ellipse fill="url(#TrianglePattern)" stroke="black" stroke-width="5"  
           cx="400" cy="200" rx="350" ry="150" />
</svg>
Example pattern01
Example pattern01 - fill a rectangle by referencing a radial gradient paint server

この例を SVG で見る( SVG 対応ブラウザのみ)
 

13.4 Gradient モジュール

要素 属性 内容モデル
linearGradient Core.attrib, XLink.attrib, Paint.attrib, Gradient.attrib, Style.attrib, External.attrib, gradientUnits, gradientTransform, x1, y1, x2, y2, spreadMethod (Description.class | Animation.class | stop)*
radialGradient Core.attrib, XLink.attrib, Paint.attrib, Gradient.attrib, Style.attrib, External.attrib, gradientUnits, gradientTransform, cx, cy, r, fx, fy, spreadMethod (Description.class | Animation.class | stop)*
stop Core.attrib, Style.attrib, Paint.attrib, Gradient.attrib, offset (Description.class | Animation.class)*

13.4.1 Gradient 内容セット

Gradient モジュールは Gradient.class 内容セットを定義する。

内容セット名 内容セットに含まれる要素
Gradient.class linearGradient, radialGradient

13.4.2 Gradient 属性セット

Gradient モジュールは Gradient.attrib 属性セットを定義する。

コレクション名 コレクションに含まれる属性
Gradient.attrib stop-color, stop-opacity

13.5 Pattern モジュール

要素 属性 内容モデル
pattern Core.attrib,, XLink.attrib, Conditional.attrib, External.attrib, Style.attrib, Presentation.attrib, viewBox, preserveAspectRatio, patternUnits, patternContentUnits, patternTransform, x, y, width, height (Description.class | Structure.class | Shape.class | Text.class | Image.class | Hyperlink.class | Script.class | Style.class | Clip.class | Mask.class | Gradient.class | Pattern.class | Filter.class | Cursor.class | Font.class | ColorProfile.class | Animation.class)*

13.5.1 Pattern 内容セット

Pattern モジュールは Pattern.class 内容セットを定義する。

内容セット名 内容セットに含まれる要素
Pattern.class pattern

13.6 DOM インターフェース

次に挙げるインターフェースが以下で定義される: SVGGradientElement, SVGLinearGradientElement, SVGRadialGradientElement, SVGStopElement, SVGPatternElement


インターフェース SVGGradientElement

SVGGradientElement インターフェースは SVGLinearGradientElement および SVGRadialGradientElement の基底インターフェースとなるものである。


IDL 定義
interface SVGGradientElement : 
                SVGElement,
                SVGURIReference,
                SVGExternalResourcesRequired,
                SVGStylable,
                SVGUnitTypes { 
  // Spread Method Types
  const unsigned short SVG_SPREADMETHOD_UNKNOWN = 0;
  const unsigned short SVG_SPREADMETHOD_PAD     = 1;
  const unsigned short SVG_SPREADMETHOD_REFLECT = 2;
  const unsigned short SVG_SPREADMETHOD_REPEAT  = 3;
  readonly attribute SVGAnimatedEnumeration   gradientUnits;
  readonly attribute SVGAnimatedTransformList gradientTransform;
  readonly attribute SVGAnimatedEnumeration   spreadMethod;
};

定義グループ Spread Method Types
定義されている定数
SVG_SPREADMETHOD_UNKNOWN タイプが定義済みのものではないことを表す。新しい値にこのタイプを定めたり、既存の値をこのタイプに変更する試みは無効である。
SVG_SPREADMETHOD_PAD pad に対応する。
SVG_SPREADMETHOD_REFLECT reflect に対応する。
SVG_SPREADMETHOD_REPEAT repeat に対応する。
属性
readonly SVGAnimatedEnumeration gradientUnits
与えられた要素の gradientUnits 属性に対応する。 SVGUnitTypes で定義されている定数のいずれか。
readonly SVGAnimatedTransformList gradientTransform
与えられた要素の gradientTransform 属性に対応する。
readonly SVGAnimatedEnumeration spreadMethod
与えられた要素の spreadMethod 属性に対応する。上の Spread Method Types で定義された定数のいずれか。

インターフェース SVGLinearGradientElement

SVGLinearGradientElement インターフェースは 'linearGradient' 要素に対応する。


IDL 定義
interface SVGLinearGradientElement : SVGGradientElement { 
  readonly attribute SVGAnimatedLength x1;
  readonly attribute SVGAnimatedLength y1;
  readonly attribute SVGAnimatedLength x2;
  readonly attribute SVGAnimatedLength y2;
};

属性
readonly SVGAnimatedLength x1
'linearGradient' 要素の x1 属性に対応する。
readonly SVGAnimatedLength y1
'linearGradient' 要素の y1 属性に対応する。
readonly SVGAnimatedLength x2
'linearGradient' 要素の x2 属性に対応する。
readonly SVGAnimatedLength y2
'linearGradient' 要素の y2 属性に対応する。

インターフェース SVGRadialGradientElement

SVGRadialGradientElement インターフェースは 'radialGradient' 要素に対応する。


IDL 定義
interface SVGRadialGradientElement : SVGGradientElement { 
  readonly attribute SVGAnimatedLength cx;
  readonly attribute SVGAnimatedLength cy;
  readonly attribute SVGAnimatedLength r;
  readonly attribute SVGAnimatedLength fx;
  readonly attribute SVGAnimatedLength fy;
};

属性
readonly SVGAnimatedLength cx
'radialGradient' 要素の cx 属性に対応する。
readonly SVGAnimatedLength cy
'radialGradient' 要素の cy 属性に対応する。
readonly SVGAnimatedLength r
'radialGradient' 要素の r 属性に対応する。
readonly SVGAnimatedLength fx
'radialGradient' 要素の fx 属性に対応する。
readonly SVGAnimatedLength fy
'radialGradient' 要素の fy 属性に対応する。

インターフェース SVGStopElement

SVGStopElement インターフェースは 'stop' 要素に対応する。


IDL 定義
interface SVGStopElement : 
                SVGElement,
                SVGStylable { 
  readonly attribute SVGAnimatedNumber offset;
};

属性
readonly SVGAnimatedNumber offset
'stop' 要素の offset 属性に対応する。

インターフェース SVGPatternElement

SVGPatternElement インターフェースは 'pattern' 要素に対応する。


IDL 定義
interface SVGPatternElement : 
                SVGElement,
                SVGURIReference,
                SVGTests,
                SVGLangSpace,
                SVGExternalResourcesRequired,
                SVGStylable,
                SVGFitToViewBox,
                SVGUnitTypes { 
  readonly attribute SVGAnimatedEnumeration   patternUnits;
  readonly attribute SVGAnimatedEnumeration   patternContentUnits;
  readonly attribute SVGAnimatedTransformList patternTransform;
  readonly attribute SVGAnimatedLength        x;
  readonly attribute SVGAnimatedLength        y;
  readonly attribute SVGAnimatedLength        width;
  readonly attribute SVGAnimatedLength        height;
};

属性
readonly SVGAnimatedEnumeration patternUnits
'pattern' 要素の patternUnits 属性に対応する。 SVGUnitTypes で定義されている定数のいずれか。
readonly SVGAnimatedEnumeration patternContentUnits
'pattern' 要素の patternContentUnits 属性に対応する。 SVGUnitTypes で定義されている定数のいずれか。
readonly SVGAnimatedTransformList patternTransform
'pattern' 要素の patternTransform 属性に対応する。
readonly SVGAnimatedLength x
'pattern' 要素の x 属性に対応する。
readonly SVGAnimatedLength y
'pattern' 要素の y 属性に対応する。
readonly SVGAnimatedLength width
'pattern' 要素の width 属性に対応する。
readonly SVGAnimatedLength height
'pattern' 要素の height 属性に対応する。