xxxxxxxxxx
16
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
// change color of ellipse based on mouse position
// more solid closer to border
// middle color yields to 125.5 ish
let brightness = map(mouseX, 0, width, 0, 255);
fill(brightness);
ellipse(mouseX, mouseY, 100, 100); // follows mouse position
console.log(mouseX, brightness); // shows correlation
}