xxxxxxxxxx
54
/*
Alina Perdomo
**Variations (loops + random)**
12/02/22
*/
var circleS = 70; //circle size
function setup() {
createCanvas(400, 400);
background(0);
for (let x = 0 + 35; x <= width; x += random(20, 100)) {
strokeWeight(random(0.5, 2));
var r = random(150, 255);
var g = random(255);
var b = random(150, 255);
fill(r, g, b);
push();
var yUp = random(35, 130); //first half
translate(x, yUp);
ellipse(0, 0, circleS);
ellipse(0, 0, circleS - random(0, 15));
ellipse(0, 0, circleS - random(15, 30));
ellipse(0, 0, circleS - random(30, 45));
ellipse(0, 0, circleS - random(45, 60));
pop();
push();
var yDown = random(200, 400); //second half
translate(x, yDown);
ellipse(0, 0, circleS);
ellipse(0, 0, circleS - random(0, 15));
ellipse(0, 0, circleS - random(15, 30));
ellipse(0, 0, circleS - random(30, 45));
ellipse(0, 0, circleS - random(45, 60));
pop();
}
}
function mousePressed () {
save("varaitions_AlinaP.jpg")
}