Class BaseGradient Abstract
Hierarchy
- BaseGradient
Index
Constructors
Accessors
Methods
Constructors
constructor
Returns BaseGradient
Accessors
color Stops
Color stops of the gradient
Returns GradientColorStop[]
Methods
add Color StopSearch playground for addColorStop
Adds a new color stop to the gradient.
Parameters
offset: number
the offset of the stop on the gradient. Should be between 0 and 1
color: string
the color of the stop
Returns void
clear Color StopsSearch playground for clearColorStops
Removes all color stops from the gradient
Returns void
get Canvas GradientSearch playground for getCanvasGradient
If there are any changes or the context changed, regenerate the canvas gradient object. Else, reuse the existing gradient.
Parameters
context: ICanvasRenderingContext
Returns CanvasGradient
get Class NameSearch playground for getClassName
Type of the gradient
Returns string
parseSearch playground for parse
Parse from json object
Parameters
serializationObject: any
Returns void
remove Color StopSearch playground for removeColorStop
Removes an existing color stop with the specified offset from the gradient
Parameters
offset: number
the offset of the stop to be removed
Returns void
serializeSearch playground for serialize
Serialize into a json object
Parameters
serializationObject: any
Returns void
Class that serves as a base for all the gradients created from context.