If interested, ping me.
I've been thinking of hacking up some code to figure out a "good" set of colours given an image. I'll let you know if I figure it out. :)
It's not that hard:
a: find the corner colors
b: find 2 of the most saturated common colors in the logo
c: calculate luminance of your chosen color, to pick black or white text
Defining 'common' in b is probably the hardest part.
If interested, ping me.