xxxxxxxxxx
52
//Pattern 1: Variations
function setup() {
createCanvas(500, 400);
var Refresh = createButton("Change Pattern")
Refresh.mousePressed(draw)
}
function draw() {
background(220);
frameRate (0)
//Color
for (var x = 0; x< width;x+= 20) {
var r = random(255)
var g = random (0,355)
var b = random (0, 255)
circle(r+20,g-50,b+60)
fill(r,b,g)
//five circle
noStroke()
for (var x = 0; x<=500; x+= 100) {
circle(x,52,100)
}
}
//2nd line of circles
for (let x =0; x <=500; x +=100) {
circle(x,152,100)
}
//3rd line of circles
for (var x = 0; x<=500; x+= 100) {
circle(x,252,100)
}
//4th line of circles
for (var x = 0; x<=500; x+=100)
circle(x, 350,100)
}