- All Superinterfaces:
JSObject
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddColorStop(double offset, String color) The CanvasGradient.addColorStop() method adds a new stop, defined by an offset and a color, to the gradient.
-
Method Details
-
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.
- Parameters:
offset- Offset between 0 and 1color- A CSS parseable color.
-