I am looking to write a script which:
- Constantly changes the background color every 1 second.
- When you first access the webpage the starting color is set based on the time of day. So if I access the website at: 7am (or close to that time) everyday it will always be a share of red no matter if I have had my browser open for 10hours.
How could I do this without loads of IF statements?
Looking here: https://stackoverflow.com/a/1455177/560287 it says there are 16776960 different colors, I dont need that many but how could I reduce this into a setInterval
so it fades through the colors of a rainbow every second?