You can see an implementation of Daron's code over here: http://www.todotoh.com/rgb/rgbanalysis.aspx

This service expands on Daron's code by doing a color analysis of the image and listing out the most frequently used colors on the image. Essentially, it tells you what color palette a page uses.