xxxxxxxxxx
34
let sb;
const colors = ["#1F509A", "#0A3981", "#E38E49"];
function setup() {
canvas = createCanvas(500, 500, WEBGL);
noFill();
sb = new Scribble();
background("#D4EBF8");
strokeWeight(3);
}
function draw() {
sb.maxOffset = 20;
randomCircles(colors);
noLoop();
}
const randomCircles = (colors) => {
const num = 100;
push();
for (let i = 0; i < num; i++) {
const x = random(-width / 2, width);
const y = random(-height / 2, height);
const r = random(30, 100);
stroke(random(colors));
sb.scribbleEllipse(x, y, r, r);
}
pop();
};
keyPressed = () => {
if (key === "s") {
saveCanvas(canvas, "canvas", "png");
}
};