To start drawing immediately with the p5 build:
- Create a
WEBGL canvas. - Scale brushes if using built-in ones:
brush.scaleBrushes(factor). - Select a brush:
brush.set(name, color, weight). - Apply fills or hatches:
brush.fill(color, alpha) or brush.hatch(density, orientation). - Draw primitives:
brush.line(), brush.rect(), brush.circle(), or brush.polygon().
function setup() {
createCanvas(700, 410, WEBGL);
background("#f6f1e8");
brush.scaleBrushes(3);
brush.set("HB", "#2f2a26", 1.4);
brush.line(-220, -80, 180, 40);
brush.fill("#d7c3a3", 120);
brush.noStroke();
brush.circle(120, 20, 70);
brush.set("rotring", "#1f4b99", 0.8);
brush.noFill();
brush.hatch(7, 35);
brush.rect(-140, 40, 120, 90, "center");
}