r

r 属性は円の半径を定義します。

この属性は次の SVG 要素で使用できます。

パーセント値は、現在の SVG ビューポートの正規化された対角線に対する割合です。これは、 <width>2+<height>22 で計算されたものです。

html
<svg viewBox="0 0 300 200" xmlns="http://www.w3.org/2000/svg">
  <radialGradient r="0" id="myGradient000">
    <stop offset="0" stop-color="white" />
    <stop offset="100%" stop-color="black" />
  </radialGradient>
  <radialGradient r="50%" id="myGradient050">
    <stop offset="0" stop-color="white" />
    <stop offset="100%" stop-color="black" />
  </radialGradient>
  <radialGradient r="100%" id="myGradient100">
    <stop offset="0" stop-color="white" />
    <stop offset="100%" stop-color="black" />
  </radialGradient>

  <circle cx="50" cy="50" r="0" />
  <circle cx="150" cy="50" r="25" />
  <circle cx="250" cy="50" r="50" />

  <rect x="20" y="120" width="60" height="60" fill="url(#myGradient000)" />
  <rect x="120" y="120" width="60" height="60" fill="url(#myGradient050)" />
  <rect x="220" y="120" width="60" height="60" fill="url(#myGradient100)" />
</svg>

circle

<circle> に関しては、r は、円の半径を定めており、したがって、その円の大きさを定めています。ゼロ以下の値を用いると、その円はまったく描画されません。

<length> | <percentage>
既定値 0
アニメーション

メモ: <circle> の半径の大きさは、 r 幾何プロパティで定義することもできます。

radialGradient

<radialGradient> において、r は、放射グラデーションの末端の円の半径を定めます。

グラデーションは、 100% の色経由点 (stop) が、この末端の円の外周に対応するように描画されます。ゼロ以下の値を用いると、グラデーションの最後の <stop> の色と不透明度を使った単一の色で、当該領域を塗りつぶすことになります。

<length>
既定値 50%
アニメーション

仕様書

Specification
Scalable Vector Graphics (SVG) 2
# RadialGradientElementRAttribute

ブラウザーの互換性

関連情報

  • CSS の r プロパティ