xxxxxxxxxx
24
var col = {
r:0,
g:0,
b:0
}
function setup() {
// This function runs only once
createCanvas(400, 400);
background(0);
}
function draw() {
// This runs over and over again!
col.r = map(mouseX, 0, 400, 0, 255);
col.b = map(mouseY, 0, 400, 0, 255);
fill(col.r, col.g, col.b);
noStroke();
circle(mouseX,mouseY,20);
}
function mousePressed(){
background(0);
}