Constructor
new module:ConicGradient(positionDefinition, startAngle, colorStops)
Conic-gradient constructor
Parameters:
Name | Type | Description |
---|---|---|
positionDefinition | PositionDefinition | Center of the gradient |
startAngle | Number | Starting angle (0 is top, 0.5 is bottom and 1 is full circle back to top) |
colorStops | Object | Set of colors to go through (key is position [from 0 to 1], value is the color) |
Example
new ConicGradient(center, 0, { 0: "red", 0.25: "orange", 0.5: "yellow", 0.75: "green", 1: "blue" });
Methods
toString(ctx) → {CanvasGradient}
Return a drawing context compatible gradient
Parameters:
Name | Type | Description |
---|---|---|
ctx | CanvasRenderingContext2D | Drawing context |
Returns:
- Type:
- CanvasGradient