@pencil.js/linear-gradient
v1.18.0
Published
Linear gradient background for Pencil.js package.
Downloads
26
Readme
Linear-gradient
Gradient transition of color(s) between two position.
Installation
npm install @pencil.js/linear-gradient
Examples
import LinearGradient from "@pencil.js/linear-gradient";
import Square from "@pencil.js/square";
const position = [100, 200];
const size = 200;
const startPosition = [0, 0];
const endPosition = [size, size];
const square = new Square(position, size, {
fill: new LinearGradient(startPosition, endPosition, {
0: "red",
0.5: "yellow",
1: "green",
}),
});