Kevin messaged me a few days ago to give me a problem his boss had given him. Generate a list of colors that can be used when drawing n lines on a graph. My first solution was to just pick 20 or 30 colors, put them an in a list and pick one of them for each graph, but I had a few other ideas. One of them seemed stupidly-simple, so I threw it together in ruby and had it generate an html page to display the results.

The code basically takes 0xFFFFFF, divides it by n and displays each color. It’s a simple hack, but the patterns it generated were just incredible. Most of the color lines aren’t distinct enough to use in graphing, so it doesn’t really match what Kevin asked me to do. Oh well, it was a fun little script to write.

This evening I read a story on reddit in which someone graphed the number results google gives vs. the number of A’s in “KHAN.” KHAN! is from the second Star Trek Movie, “The Wrath of Khan.” The original results from that article are here. I thought it was pretty funny, so I decided to write a ruby script to automatically do the same thing (I’ve been using ruby a lot lately).