6 Responses to “Making annoying rainbows in javascript”
Leave a Reply
You must be logged in to post a comment.
![]() |
|
Making annoying rainbows in javascript6 Responses to “Making annoying rainbows in javascript”Leave a ReplyYou must be logged in to post a comment. |
|
October 21st, 2006 at 11:55 am
To further generalize, I would set up the function to allow different centers and widths for each color component, which would allow us to produce a rainbow of greens-blues, for example.
I’m curious to look up a way to make a web page’s javascript run on timed intervals after loading, so that one could make a background with fluctuating colors. Or maybe white-on-black to black-on-white fluctuating. That would be fun and annoying! :D
October 28th, 2006 at 5:11 am
Agreed.
November 8th, 2006 at 6:58 am
I believe the setTimeout() and setInterval() functions will allow you to do just that :)
March 17th, 2007 at 6:23 pm
[...] A little something I made for my students during today’s actionscript class. Here’s the flash source code, and here’s an article that explains the technique I use to generate those groooovy colors. [...]
March 8th, 2008 at 10:25 pm
This article is really cool!
BTW, to convert hex-to-dec in JavaScript you can also use:
var num = 170;
num.toString(16);
or
(170).toString(16)
To binary?
toString(2).March 8th, 2008 at 11:16 pm
Stoyen: True, but there is still a need to add the leading zero padding when producing hex digits for single digit numbers. A sprintf() function would make things much easier, since you can use “%02x” to specify a 2-digit hex number with zero-padding.