Github Source Files
This HEX background color changing app was also short and sweet to complete.
However, I did find the instructor's solution interesting.
The idea was to make a random hex value created from an array of all the possible different hex values, loop through them, and concatenate 6 different values to a String that begun with the # character.
In other words, once the HEX value string is created, you'd simply change the background color to that value just like in the change background color project.
New things learned or refreshed
I learned that the simplest solution is probable the best solution.
I spent a lot of time trying to figure out the best way to create a HEX value with creating an array. But, turns out the array was a pretty simple solution.
Lines of code: 19 lines of code.
Time to code: This took about 7 minutes to code.
Biggest take away: KISS. Keep it Simple. Make a working solution. Refactor if you must, later.
What to accomplish:
- Download the source code from the github repository above.
- Delete the
- Every time the button is clicked, the background should changes color and you should show the Hex value of the color.
- Add a link to your finished project below!
Need to see the video solution for this project?