pencil.js / conic-gradient / ConicGradient
Class: ConicGradient
Defined in: conic-gradient.ts:20
Conic gradient usable as fill or stroke
Constructors
Constructor
ts
new ConicGradient(
positionDefinition,
startAngle?,
colorStops?
): ConicGradient;Defined in: conic-gradient.ts:40
Conic gradient constructor
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
positionDefinition | | PositionDefinition | undefined | undefined | Center of the gradient (relative to the component) |
startAngle? | number | 0 | Starting angle (0 is top, 0.5 is bottom and 1 is full circle back to top) |
colorStops? | ColorStops | {} | Set of colors to go through (key is position [from 0 to 1], value is the color) |
Returns
ConicGradient
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) | conic-gradient.ts:32 |
position | Position | Center of the gradient | conic-gradient.ts:26 |
startAngle | number | Starting angle (0 is top, 0.5 is bottom and 1 is full circle back to top) | conic-gradient.ts:29 |
Accessors
className
Get Signature
ts
get static className(): "ConicGradient";Defined in: conic-gradient.ts:21
Returns
"ConicGradient"
Methods
toJSON()
ts
toJSON(): ConicGradientJSON;Defined in: conic-gradient.ts:58
Return a json ready object
Returns
toString()
ts
toString(ctx): CanvasGradient;Defined in: conic-gradient.ts:50
Return a canvas gradient
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | CanvasRenderingContext2D | Drawing context |
Returns
CanvasGradient
from()
ts
static from(definition): ConicGradient;Defined in: conic-gradient.ts:71
Return an instance from a generic object
Parameters
| Parameter | Type | Description |
|---|---|---|
definition | Omit<ConicGradientJSON, "constructor"> | ConicGradient definition |
Returns
ConicGradient
