xxxxxxxxxx
31
let offset = 0;
let extraCanvas;
function setup() {
createCanvas(windowWidth, windowHeight);
extraCanvas = createGraphics(windowWidth, windowHeight);
extraCanvas.clear();
background(0);
}
function draw() {
rainbow(extraCanvas);
image(extraCanvas, 0, 0, windowWidth, windowHeight);
}
function rainbow(canvas) {
let r = noise(offset * 0.2) * 255;
let g = noise(offset * 0.3) * 255;
let b = noise(offset * 0.1) * 255;
canvas.stroke(r, g, b);
canvas.strokeWeight(20);
let w = noise(offset * 0.1) * width;
let h = noise(offset * 0.1) * height * 1.5;
offset += 0.01;
canvas.arc(width / 2, (height / 10) * 8, w, h, PI, 0);
}