Firefox Tomorrow

web api interface

CanvasGradient

View on MDN ↗

Available in workers

The CanvasGradient interface represents an opaque object describing a gradient. It is returned by the methods createLinearGradient(), createConicGradient() or createRadialGradient().

It can be used as a fillStyle or strokeStyle.

Instance properties

As an opaque object, there is no exposed property.

Instance methods

  • addColorStop()
    • : Adds a new stop, defined by an offset and a color, to the gradient.

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also