UNPKG

p5.js-svg

Version:

The main goal of p5.SVG is to provide a SVG runtime for p5.js, so that we can draw using p5's powerful API in \<svg\>, save things to svg file and manipulating existing SVG file without rasterization.

18 lines (12 loc) 244 B
import p5 from "p5" import p5Svg from "p5.js-svg" p5Svg(p5); const sketch = (p) => { p.setup = () => { p.createCanvas(100, 100, p.SVG); } p.draw = () => { p.background(0); } } new p5(sketch, document.body);