CanvasGradient
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
Please help us by answering a few questions.
CanvasGradient
インターフェイスは、グラデーションを記述する不透明オブジェクトを表します。 CanvasRenderingContext2D.createLinearGradient()
または CanvasRenderingContext2D.createRadialGradient()
メソッドから返されます。
fillStyle
または strokeStyle
として使用することができます。
プロパティ
不透明オブジェクトとして、公開されているプロパティはありません。
メソッド
継承されたメソッドはありません。
CanvasGradient.addColorStop()
-
offset
およびcolor
で定義される、グラデーションの新しい停止点を追加します。オフセットが0
と1
の間でなければINDEX_SIZE_ERR
が発生し、色が CSS の<color>
として解釈できない場合はSYNTAX_ERR
が発生します。
仕様書
Specification |
---|
HTML # canvasgradient |
ブラウザーの対応
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
CanvasGradient | ||||||||||||
addColorStop |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- See implementation notes.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
関連情報
CanvasRenderingContext2D
のクリエイターメソッド<canvas>
要素と関連するHTMLCanvasElement
インターフェイス