You're defining colors as an array instead of an object.

You just need to initialize it properly:

 var colors = {}; // or new Object();




Additional suggestion... there's really no need for the jQuery.each here.  Iterating over an associative array like this (let's not argue the semantics of whether you can actually call this an associative array) looks like this:

function updateColors(colors)
{
    for (var key in colors)
    {
        $("#storage_display").html("var "+$("#storage_display").html()+" " +colors[key]);
    }
}


Adding elements into associative array in javascript
In Bill and Ted's Excellent Adventure, we never see Rufus introduce himself to Bill and Ted. Instead, Future Bill says to Present Bill and Present Ted: "Listen to this dude, Rufus. He knows what he's talking about."

How did Future Bill know what Rufus's name was? Did he read it in the history books?

This has been on my mind for a while.
