Project 02 is only a small step forward from project 01. In this project, I added an array with a scheme of five colors.
I considered making the color choice completely random, but I decided that I would prefer to pick from a set of colors that will work together visually.
Something to think about – how random is random enough? by placing only boxes, and by constraining the color scheme to five possible colors, is this truly random? What are the chances that the screen will look exactly the same twice?
Is the choice of colors in the color scheme, a sign of an artists hand in the creation of this work, even though there is no predicting exactly what it will look like?
Code Snippets for 02
The HTML and CSS for the second project are the same as in the first project. The step forward for this one is the addition of an array for colors in a color scheme. I could generate colors completely randomly, but I wanted sets of colors that would work together, visually.
Below is the entire function for creating, or depending on circumstances, removing boxes from the screen. You can see in the comment below on line 19 where I have added the random choice of a color from the color scheme.