Off-screen canvas for Pencil.js package.
npm install @pencil.js/offscreen-canvasUtility to render on a non displayed canvas and extract data from it.
npm install @pencil.js/offscreen-canvas
``js
import OffScreenCanvas from "@pencil.js/offscreen-canvas";
const circle = new Circle([0, 0], radius);
const offScreen = new OffScreenCanvas(width, height);
offScreen.render(circle);
// or
circle.render(offScreen);
const imageData = offScreen.imageData;
`
| Name | Type | Default | Comment |
| ---- | ---- | ------- | ------- |
|fill |Color or String |null |Background color |Number
|opacity | |1` |Global opacity |