UNPKG

pencil.js

Version:

Nice modular interactive 2D drawing library.

29 lines (28 loc) 1.1 kB
/** * @module ConicGradient */ /** * Conic-gradient class * <br><img src="./media/examples/conic-gradient.png" alt="conic-gradient demo"/> * @class */ export default class ConicGradient { /** * Conic-gradient constructor * @param {PositionDefinition} positionDefinition - Center of the gradient * @param {Number} startAngle - Starting angle (0 is top, 0.5 is bottom and 1 is full circle back to top) * @param {Object} colorStops - 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" }); */ constructor(positionDefinition: PositionDefinition, startAngle: number, colorStops: any); position: Position; startAngle: number; colorStops: any; /** * Return a drawing context compatible gradient * @param {CanvasRenderingContext2D} ctx - Drawing context * @return {CanvasGradient} */ toString(ctx: CanvasRenderingContext2D): CanvasGradient; } import Position from "@pencil.js/position";