I’m trying to make a background that changes color when the mouse moves around the screen. I’ve found some code that works but when I try pasting the working parts into my code it stops working
The working parts:
fill(mouseX,mouseY,100);
This fill allows a rectangle to change colors as I move the mouse around. However, this does not work for any of the simple shapes I’ve made. I went through his code more but couldn’t find anything else that effects the color changing.I found some more code that changes the color when you click it and I’d like to know if I can change a few things and have it work for changing my background.
color bColor = color(255, 255, 255);
void setup() {
size(400, 400);
}
void draw() {
background(bColor);
}
void mousePressed() {
bColor = color(random(255), random(255), random(255));
}