3 ms·
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 alternat
by lkozma 16y 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/ 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))) + ")"});
};
- tunaslut 16y agocool....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 http://www.coloringout.com/colorclock someone should make the timezones selectable :)