xxxxxxxxxx
24
function setup() {
createCanvas(400, 400);
}
function draw() {
colWidth = width / 20;
let colColor = map(mouseX, 0, width, 0, 255);
background(220);
// fill('red');
for (var c = 0; c < 20; c++) {
x = colWidth * c;
if (mouseX> x && mouseX< x +colWidth){
fill(colColor, colColor, 0);
rect(x, 0, colWidth, height);
}
}
}