Hello! I setup the color could be changed from 2 pink colors. I hope after dragging to a color that I like (between color A and color B), I can decide and make the color as background color (maybe by mousePressed()) And then the color will not change when the mouse move again. I am not sure how to add the void mousePressed and hopefully you could help! Thanks!
void setup() {
size(600, 600);
}
void draw() {
color colorA = color(#F2ACB9);
color colorB = color(#f27999);
float value = map(mouseX, 0, width, 0, 1);
color colorC = lerpColor(colorA, colorB, value);
background(colorC);
}
Hello! Yes, I hope the color would change while the mouse is dragging across screen. But actually, I hope after dragging to a color that I like (between color A and color B), I can decide and make the color as background color (maybe by MouseClicked?) The color will not change when the mouse move again. But I don’t know how to do that function. Thank you~