Hexadecimal Clocks in Javascript

10, Jan 2015 -- javascript, ot, time

Hexadecimal clocks are kind of interesting. They take the hours, minutes and seconds of the current time, and concantenate them to form a hexadecimal color. For example, if the time were 11:14:45, we would display the color #111445. This is the 'classic' hexadecimal clock. I have reproduced it here: Original Hex. Clock

Here's a slightly different mapping. In this mapping, we use a 12-hour/am/pm clock, and use the hexadecimal equiavlent of the hours for the red digts in the hex color. For example, 11:14:45 am maps to #0B1445. Here it is: Hex. Clock - Hex Hours Representation.

Now something quite different. We take the Unix timestamp, convert it to hex, and use the six least significant hex figures as the color. This will go through all colors, #000000, #FFFFFF, which is 16777216 different colors. 16777216 seconds is 194 or so days! So the color you see right now won't appear again for about a half year. Hex. Clock - Unix Time.

(update: January 31st): Okay, how about this: We map hours:minutes:seconds onto an HSL(hours,minutes%,seconds%) color scheme. (For the uninitiated, HSL stands for Hue, Saturation, Lightness). This mapping leaves something to be desired, since minutes% and seconds% will max out at 60%. Not that all the other clocks are perfect... Hex. Clock - HSL mapping.

Copyright My Internet Weblog. Powered by kindablog