Assignment 1 Cody Colgren

//program made by Cody Colgren
void setup()
{
size(500, 400);
strokeWeight(0);
stroke(0, 100);
smooth();
}

void keyPressed()
// if the ‘z’ key is pressed the image will reset, if the ‘s’ key is pressed it will take a screenshot
{
if (key == ‘z’) {
background(255,255,255);
}
if (key == ‘s’) {
saveFrame(“drawing-####.png”);
}
}

void draw()
{
//if the user clicks the mouse it will create a triangle with a color depending on mouse location
if (mousePressed == true) {
triangle(mouseX, mouseY, 0, 45, 45, 45);
fill(mouseY, 165, mouseX, 100);
}
//if the user clicks the mouse it will create a circle with a color depending on mouse location
if (mousePressed == false) {
ellipse(mouseX, mouseY, 35, 35);
fill(mouseX,mouseY, 165, 165);

}
}