xxxxxxxxxx
//This "setup" function is called once, at start
function setup() {
createCanvas(600, 600); // width and height, in pixels
noLoop(); // This says: only call draw() once, please!
}
function flower(x, y) {
const pallet = [
'#542344',
'#bfd1e5',
'#ebf5ee',
'#d8bfaa',
'#808080'
];
for (i = 200; i > 0; i -= 20) {
fill(random(pallet))
circle(x, y, i);
}
}
// We put our drawing commands in this "draw" function.
// It will be called automatically.
function draw() {
noStroke();
background("lightblue");
for (j = 0; j <6; j++) {
let x = j*100;
let y = j*100;
flower(x,y);
}
}
function mousePressed() {
redraw();
}