# class CanvasGradient

#### package js.html

Available on HTML5

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

Documentation CanvasGradient by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See:

https://developer.mozilla.org/en-US/docs/Web/API/CanvasGradient

### Methods

###

`addColorStop (offset:Float, color:String):Void`

Throws:

`null` | DOMError