Not sure this is possible, but looking to write a script that would return the average hex or rgb value for an image. I know it can be done in AS
hex
rgb
As pointed out in other answers, often what you really want the dominant color as opposed to the average color which tends to be brown. I wrote a script that gets the most common color and posted it on this gist