xxxxxxxxxx
20
function setup() {
createCanvas(600, 400);
background(100, 0, 100, 100);
rectMode(CENTER);
// fill(255, 0, 0);
// noStroke();
// rect(width/2, height/2, 50, 50);
// stroke(1);
// line(0, 0, width, height);
// line(0, height, width, 0);
noStroke();
}
function draw() {
//mouseX and mouseY
var xColor = map(mouseX, 0, width, 0, 255);
var yColor = map(mouseY, 0, height, 0, 255);
fill(xColor, yColor, 200);
rect(mouseX, mouseY, 100, 100);
}