top of page
CLICK ME

Problem:
Creating multiple drawing behaviors that share the same visual aesthetic without building
completely separate systems for each tool.


Solution:
Built three organized functions, s
eparating the input, color generation, and brush behavior so the code is easier to manage, reuse, and expand. If somebody wanted to add more colors, different brushes, or new commands, it is easy for another developer or collaborator to understand.

getColor() : Generates randomized RGB values within controlled ranges (creates 3D illusion) based on if statement.


keyPressed() : Maps keyboard inputs to specific commands (brush size and selection, colors,
erasing)

Screenshot 2026-09-24 at 6.20.38 PM.png
Screenshot 2026-09-24 at 6.20.11 PM.png

drawBrush() : Switch statement to change between 4 different brushes (Lines, freehand, circles, and squares). Each brush is set to the location of the mouse and draws their assigned shape when mouse is pressed. 

bottom of page