iWantHue allows you to generate palettes of colors. It is about mastering the properties of a palette by setting a range of Hue, Chroma (unbiased saturation) and Lightness. You can generate palettes of any size or just get the generator for a javascript project. The algorithm optimizes the perceptive distance in the color subspace, ensuring an optimal readability.
How it works:
K-means or force vector repulsion algorithms ensure an even distribution of colors
The CIE Lab color space is used for computation, since it fits human perception
The Hue/Chroma/Lightness color space is used to set constraints, since it is user-friendly