xxxxxxxxxx
21
function setup() {
createCanvas(400, 400);
}
function draw() {
// background(220);
let col1 = color(0,0,mouseY);
let col2 = color(mouseX,0,0);
for (x = 0; x < mouseX; x += 20) {
for (y = 0; y < mouseY; y += 20) {
let amt = (x+y)/800;
let fillCol = lerpColor(col1,col2, amt);
fill(fillCol);
noStroke();
square(x,y,40)
}
}
}