So it turns out that I started the foundation for this week's assignment to create a painting app in my explorations last week. For any of my previous examples, simply add a background into the setup() function and remove any filled rects from the draw() loop and the "paint" sticks to the canvas.
In considering the requirements for a painting system, I thought about brush shape and size, as well as paint color and application amount. Extending my Painting with Random Lines sketch allowed me to play with all of these.
First, however, I was curious to see the brush without any color loaded. This is the nearly the same code from Painting with Random Lines, except that mouse is not mapped to change the color of the background. I'll filled the entire canvas in the screenshot above to give a sense of the underlying shapes in my brush. Click through to the OpenProcessing sketch to try it--just click and drag the mouse to paint!
To the empty paintbrush I added features to change brush size and paint color:
Pressing the up arrow increases brush size, while the down arrow decreases.
"R" increases the amount of red in the combined RGB color, lower case "r" decreases.
"G" increases the amount of red in the combined RGB color, lower case "g" decreases.
"B" increases the amount of red in the combined RGB color, lower case "b" decreases.
Currently, the RGB color values print to the console providing a useful tool to understand how to create different colors with varying amounts of R, G, and B.
Finally, the alpha setting is set very low for this brush, so the transparency is very high, allowing one to build up color the longer the mouse is pressed in one area and to play with mixing colors already applied to canvas.
Though brush shape modifies slightly with changes in size, ideally I would incorporate more distinct options in a future iteration of this project.