Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 545 Bytes

readme.md

File metadata and controls

24 lines (18 loc) · 545 Bytes

Radial-gradient

Circular gradient transition of color(s) between a center and the radius of a circle.

Radial-gradient example

Examples

import { RadialGradient, Square } from "pencil.js";

const position = [100, 200];
const size = 200;
const centerPosition = [size / 2, size / 2];
const radius = size / 2;
const square = new Square(position, size, {
    fill: new RadialGradient(centerPosition, radius, {
        0: "red",
        0.5: "yellow",
        1: "green",
    }),
});