For my work I had the need to dynamically color code many objects, and I have to make sure that all the colors used are both distinguishable and the text inside them legible. So, I whipped up a little jQuery and built a tool for making and editing color-code schemes: ColorCode Lineup. You can view source to see the code, but it's also hosted on github.