CanvasGradient

external class CanvasGradient(source)

An opaque object describing a gradient. It is returned by the methods CanvasRenderingContext2D.createLinearGradient() or CanvasRenderingContext2D.createRadialGradient().

MDN Reference

Functions

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

Adds a color stop with the given color to the gradient at the given offset. 0.0 is the offset at one end of the gradient, 1.0 is the offset at the other end.