The Hex Code Clock

nasser
3 min readOct 20, 2015

--

Okay I’ll admit, this wasn’t an original idea.

Hexcode clocks have existed on the internet in some way/shape/form for a few years now. But as a recent convert to the OS X world, I didn’t see myself seeking out some obscure domain to see this cool thing once in a while — I wanted it to regularly appear in my life without me really having to do anything about it. So it dawned on me: screen savers!

Remember, those old things that you’d sit at your computer and instruct your friends not to touch the mouse so you could see — this?

If you’re like me, then you don’t use screen savers anymore. On top of not really being updated, it just made more sense to turn the screen off than to leave it running with some outdated animation.

Even now, I’m not really sure why I made this — beyond really liking the hex clock. I don’t even use Screen Savers! (I do use this, now).

If you’re looking at the pictures, and wondering what it is exactly that I did: let me explain. I built an OSX Screensaver in Swift 2.0. The idea is, that time would be formatted as HHmmss, but in 24-hour format. If we take that, turn it into a string, and run it though NSColor as hex, we get our HexCodeClock!

For example:

  • It is currently 3:17:23pm.
  • We take that in 24-hour time, as 15:17:23
  • Remove the colons: 151723
  • Add a pound sign so the time becomes a hexcolor: #151723

Here it is in fast-forward action:

Where do I get it?

If you’ve read this far, I’m assuming you want to give it a spin. Awesome! Here’s the link :)
To install, double click the .saver file, and then go to Desktop & Screen Saver to preview the Screen Saver. (Compatible with OSX 10.9 and newer)

Are you a developer? Fork me on Github! — this was written using Xcode 7.0.1 & Swift 2.0.

This article was original posted on my personal blog.

--

--