xxxxxxxxxx
37
/* Pattern Variations
By Qingyun Zhu
11/14/22
*/
function setup() {
createCanvas(500, 400);
background('#FDFAE0');
}
function draw(){
function star(x,y,radius)
{
push();
translate(x,y);
for(i=0;i<5;i++)
{
rotate(PI*72/180);
bezier(radius/2,0,2,-1.5*radius,-2,-1.5*radius,-radius/2,0);
}
pop()
}
let y = 250+ random(-50, 50);
for (let x = 10; x <= width; x += 50){
let r = random(256);
let g = random(256);
let b = random(200);
fill(r, g, b);
star(random(width),random(height),40);
star(random(220),random(256),20);
}
noLoop()
}