there is a JQuery plugin that makes a color palette from an image, it would be grat to make them work toghether.

http://lokeshdhakar.com/projects/color-thief/