Move mouse or finger to search for best moire locations. Press any key to save.
A fork of Animated Moire by Martine Hage
xxxxxxxxxx
//let colors = ["#f7e1d7", "#ffdac6", "#588157", "#3a5a40", "#344e41"];
let greens = ["#588157", "#3a5a40", "#344e41"];
let pinks = ["#f7e1d7", "#ffdac6"];
function setup() {
createCanvas(1680, 834);
smooth();
noStroke();
mouseX = width / 2;
mouseY = height / 2 - 20;
}
function draw() {
background(random(greens));
push();
translate(width/2, height/2);
fill(random(greens));
drawStar();
push();
push();
translate(mouseX - width/2, mouseY - height/2);
rotate(TWO_PI * frameCount/800);
fill(random(pinks));
drawStar();
push();
}
function drawStar() {
let numSpokes = 100;
for (let i=0; i<numSpokes; i++) {
let t0 = map(i, 0, numSpokes-1, 0, TWO_PI);
let t1 = t0 + (TWO_PI/(2*numSpokes));
arc(0, 0, 3000, 3000, t0, t1);
}
}
//
function keyTyped(){
save('pix.jpg')
}