Question: art 4 : Generate a Random Color For this project, you'll need to code your own random number generator function. This function must return a

art 4: Generate a Random Color
For this project, you'll need to code your own random number generator function. This function must return a random number using Math.random() between 0 and 255, the valid ASCII values for a color in HTML and CSS.
>> Create a function generateRandomColor() that returns a random number between 0 and 255. Use Math.floor() and Math.random().
>> Add code to test your function to make sure a random number within the valid range is generated.
>> Comment out your test code once generateRandomColor() works correctly.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!