LzCanvasGradient

An object for describing gradient fills

The <LzCanvasGradient> is used by drawview to describe a gradient fill.


Methods

addColorStop()
LzCanvasGradient.addColorStop(o, c)

Adds a new stop to a gradient. gradients are rendered such that at the starting point the colour at offset 0 is used, that at the ending point the color at offset 1 is used. globalAlpha is stored for each gradient step added.

Parameters
Name Type Desc
o Number The offset this stop used for placement in the gradient. Gradients are rendered such that for the starting point the colour at offset 0 is used, that at the ending point the color at offset 1 is used and all colors between those offsets are blended. Must be less than 0 or greater than 1.
c Number The color to be used at this color. A hexadecimal value, e.g. 0xffffff


constructor()
LzCanvasGradient()

LzCanvasGradient is an opaque object, which is used for assigning to other attributes, e.g. fillStyle. It is also used to add color stops. An LzCanvasGradient is returned by LzDrawView.createRadialGradient or LzDrawView.createRadialGradient.