Results 1 - 4 of 4

CanvasGradient

The CanvasGradient interface represents an opaque object describing a gradient. It is returned by the methods CanvasRenderingContext2D.createLinearGradient() or CanvasRenderingContext2D.createRadialGradient().
API Canvas CanvasGradient Gradients Interface Reference

CanvasGradient.addColorStop()

The CanvasGradient.addColorStop() method adds a new stop, defined by an offset and a color, to the gradient. If the offset is not between 0 and 1, an INDEX_SIZE_ERR is raised, if the color can't be parsed as a CSS <color>, a SYNTAX_ERR is raised.
API Canvas CanvasGradient Gradients Method Reference Référence

CanvasRenderingContext2D.createLinearGradient()

The CanvasRenderingContext2D.createLinearGradient() method of the Canvas 2D API creates a gradient along the line given by the coordinates represented by the parameters. This method returns a linear CanvasGradient.
API Canvas CanvasRenderingContext2D Gradients Method Reference

CanvasRenderingContext2D.createRadialGradient()

The CanvasRenderingContext2D.createRadialGradient() method of the Canvas 2D API creates a radial gradient given by the coordinates of the two circles represented by the parameters. This method returns a CanvasGradient.
API Canvas CanvasRenderingContext2D Gradients Method Reference