pencil.js / radial-gradient / RadialGradient
Class: RadialGradient
Defined in: radial-gradient.ts:19
Radial gradient usable as fill or stroke
Constructors
Constructor
ts
new RadialGradient(
positionDefinition,
radius?,
colorStops?
): RadialGradient;Defined in: radial-gradient.ts:39
Radial gradient constructor
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
positionDefinition | | PositionDefinition | undefined | undefined | Center of the gradient (relative to the component) |
radius? | number | 0 | Radius of the gradient |
colorStops? | ColorStops | {} | Set of colors to go through (key is position [from 0 to 1], value is the color) |
Returns
RadialGradient
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
colorStops | ColorStops | Set of colors to go through (key is position [from 0 to 1], value is the color) | radial-gradient.ts:31 |
position | Position | Center of the gradient | radial-gradient.ts:25 |
radius | number | Radius of the gradient | radial-gradient.ts:28 |
Accessors
className
Get Signature
ts
get static className(): "RadialGradient";Defined in: radial-gradient.ts:20
Returns
"RadialGradient"
Methods
toJSON()
ts
toJSON(): RadialGradientJSON;Defined in: radial-gradient.ts:57
Return a json ready object
Returns
toString()
ts
toString(ctx): CanvasGradient;Defined in: radial-gradient.ts:49
Return a canvas gradient
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | CanvasRenderingContext2D | Drawing context |
Returns
CanvasGradient
from()
ts
static from(definition): RadialGradient;Defined in: radial-gradient.ts:70
Return an instance from a generic object
Parameters
| Parameter | Type | Description |
|---|---|---|
definition | Omit<RadialGradientJSON, "constructor"> | RadialGradient definition |
Returns
RadialGradient
