Working on this program for a project in class, I am wondering what I must do to make it so the stroke only draws when the mouse is clicked. At this point when the mouse hovers over the running program it automatically draws. This is the program. Could someone point me in the right direction?
int White;
int Black;
float h;
float s;
float b;
color CurrentColor;
void setup()
{
size(640,480);
background(255);
frameRate(60);
s = saturation(0);
b = brightness(0);
h = hue(0);
Black = color(0);
White = color(255);
CurrentColor = color(255);
}
void draw()
{
fill(Black);
rect(0,0,30,30);
if (mousePressed)
{
noStroke();
fill(CurrentColor);