Hacker News new | ask | show | jobs
by lkozma 5592 days ago
Here's a version that cycles through the colors continuously (without jumps). Now the numbers do not directly corespond to the color code anymore (they alternate going up-down). Also you can multiply by 256, as the maximum is not reached for any of the values.

I uploaded it here: http://lkozma.net/colorclock/

  d     = t.getTime()/(1000 * 60 * 60 * 24),

  ...

  body.animate({"background-color":
                 "rgb(" + 
		  (((d%2)==1) ? parseInt((h / 24) * 256) : (255-parseInt((h / 24) * 256))) + "," +
                  (((h%2)==1) ? parseInt((m / 60) * 256) : (255-parseInt((m / 60) * 256))) + "," +
                  (((m%2)==1) ? parseInt((s / 60) * 256) : (255-parseInt((s / 60) * 256))) + ")"});
  };
1 comments

cool....I hacked in some timezones - 4 clocks on the page - local, london, new york, tokyo...if I got my maths right that is:

http://www.coloringout.com/colorclock

someone should make the timezones selectable :)