pencil.js
Version:
Nice modular interactive 2D drawing library.
26 lines (16 loc) • 659 B
Markdown
Utility to render on a non displayed canvas and extract data from it.
```js
// This will override the native OffscreenCanvas class !
import { OffScreenCanvas, Circle } from "pencil.js";
const offScreen = new OffScreenCanvas(width, height);
offScreen.add(new Circle([0, 0], radius));
const imageData = offScreen.getImageData();
```
Inherit from [ContainerOptions](../container/readme.md
| Name | Type | Default | Comment |
| ---- | ---- | ------- | ------- |
|fill |[Color](../color/readme.md) or `String` |`null` |Background color |
|opacity |`Number` |`1` |Global opacity |