Smart Button



void draw() {
    fill(0, 255, 68); // start color
    if (mousePressed && mouseX > 50 && 300 > mouseX && mouseY > 150 && 250 > mouseY) {
        fill(255, 0, 0);  // click color
    }
    rect(50, 150, 250, 100);  // the button
    // The button text
    fill(0, 0, 0);
    textSize(30);
    text("PRESS ME!", 93, 193);
};