Class BaseGradientAbstract
Hierarchy (View Summary)
- BaseGradient
Constructors
constructor
-
Returns BaseGradient
Accessors
color Stops
-
Color stops of the gradient
Returns GradientColorStop[]
Methods
add Color Stop
-
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
- offset: number
clear Color Stops
-
Removes all color stops from the gradient
Returns void
get Canvas Gradient
-
If there are any changes or the context changed, regenerate the canvas gradient object. Else, reuse the existing gradient.
Parameters
- context: ICanvasRenderingContext
the context to create the gradient from
Returns CanvasGradient
the canvas gradient
- context: ICanvasRenderingContext
get Class Name
-
Returns string
Type of the gradient
parse
-
Parse from json object
Parameters
- serializationObject: any
object to parse from
Returns void
- serializationObject: any
remove Color Stop
-
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
- offset: number
serialize
-
Serialize into a json object
Parameters
- serializationObject: any
object to serialize into
Returns void
- serializationObject: any
Class that serves as a base for all the gradients created from context.