xxxxxxxxxx
35
function setup() {
createCanvas(700, 700);
background("rgb(255,0,190)");
}
function draw() {
// loop 10 times
for (let index = 0; index < 12; index++) {
// use the index to calculate the y position
let y = index * 41;
for (let index2 = 0; index2 < 12; index2++) {
// use the index to calculate the y position
let x = index2 * 41;
circle(y + 25, 30, 30);
}
}
// add 20 because that is half of the size
let c = map(mouseY, 0, width, 0, 300);
fill(c);
describe(
"A circle changes color from black to white as the mouse moves from left to right."
);
}