Add a new stop, defined by an offset and a color, to the gradient.
Add 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.
MDN
The CanvasGradient interface represents an opaque object describing a gradient and returned by CanvasRenderingContext2D.createLinearGradient or CanvasRenderingContext2D.createRadialGradient methods.
MDN