CanvasGradient

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

MDN Reference

Functions

Link copied to clipboard
fun addColorStop(offset: Double, color: String)

The CanvasGradient.addColorStop() method adds a new color stop, defined by an offset and a color, to a given canvas gradient.