Website Colours Decided by Time

What?

This is a small proof-of-concept page, in which the colours change based on the time of day.

How?

It's simple really. In JavaScript, we see how much time has passed since midnight, and express that as a percentage. We then take that percentage to update some CSS custom properties for a light and a dark colour.

Why?

I dunno yet. But I am imagining some interesting design possibilities with websites changing colours, layout, etc based on arbitrary variables.