Live data from Hacker News

The Colour Clock

thecolourclock.co.uk

91–95 of 95 posts

Re: The Colour Clock

#91

Earlier quoted context omitted.

I missed it. It basically goes from white (well, very pale cyan) to bright red, right?

#FFFFFF to #000000 would be white to black.

I made my comment at about 23:05 last night, my local time; I was talking about 22:59:59 to 23:00:00, or (approximately) #F5FFFF to #FF0000.

Re: The Colour Clock

#93
post #64
post #28

Earlier quoted context omitted.

I can not figure out how such a simple program can manage to take up 100% of my CPU, and despite that not be in sync with my actual clock (it's a random fraction of a second off). Has he not heard of sleep(1) ? Saying "it's flash" is no excuse, flash is perfectly capable of sleeping.

Updating a clock to display the correct time is actually difficult and involved, sleep(1) will not work! The problem reminds me of this Intel article on syncing video output [1] Basically, sleep(1) won't always align with clock updates, so sometimes a given time will display for more or less time than a second. This can be observed by opening the clock widget on Windows XP for example, it's very noticeable. I don't a…

Rather useful in this case could be an adaptive method. First, you update every 50ms until you circled in the moment when the second toggles. Then you can do sleep(1) again and save resources.

Alternatively, use time() to only sleep the remaining timespan until the next second.

Re: The Colour Clock

#94
post #31

Earlier quoted context omitted.

Honest question - what is the HTML5 part in here (as opposed to I rewrote it in HTML+CSS+JS)?

Even though the implementation above doesn't use any HTML5-specific features, the term is becoming a synonym for Dynamic HTML.

I'd also argue it's becoming a synonym for "Not Flash!?!"

Re: The Colour Clock

#95
post #34
post #15

Awesome idea. I took some time to rewrite in HTML5: http://brisy.info/colors/ Though the colours I'm getting are different. I wonder why.

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(…

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 :)

Post reply on HN