Blog   Free Screensavers   Coverpop   Puzzles!
Fun & Games   Colr Pickr   Flash Bestiary   About KrazyDad

« My dog loves Beck videos
Fantabulous Flickr Friday »

Making annoying rainbows in javascript

If you‘ve been looking for a tutorial on how to make these kinds of annoying color effects in javascript, you’ve come to the right place, as I’ve written one.

And here it is.

This entry was posted on Friday, October 13th, 2006 at 2:11 am and is filed under Linkydinks. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

6 Responses to “Making annoying rainbows in javascript”

  1. Gemini6Ice Says:
    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

  2. jbum Says:
    October 28th, 2006 at 5:11 am

    Agreed.

  3. Japh Says:
    November 8th, 2006 at 6:58 am

    I believe the setTimeout() and setInterval() functions will allow you to do just that :)

  4. KrazyDad » Blog Archive » Lucky Charms Says:
    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. [...]

  5. stoyan Says:
    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).

  6. jbum Says:
    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.

Leave a Reply

You must be logged in to post a comment.






Entries (RSS) and Comments (RSS).
Copyright © 2008 Jim Bumgardner. All Rights Reserved.
Leave Jim some feedback.