Edit in GitHubLog an issue

window.CanvasGradient

See: Web APIs - CanvasGradient for more details
Also, refer to the interface HTMLCanvasElement

Since: v7.0.0

addColorStop(offset, colorValue)

Adds a new color stop, defined by an offset and a color value, to a given canvas gradient.

Throws:

  • DOMException

See: CanvasGradient - addColorStop for more details

ParamTypeDescription
offset
number
A number between 0 and 1, inclusive, representing the position of the color stop. 0 represents the start of the gradient and 1 represents the end.
colorValue
string
A CSS <color> value representing the color of the stop.
Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.