Hacker News new | ask | show | jobs
by microtonal 4450 days ago
I have recently written a library that picks N as distinct possible from the RGB color space. Since RGB is not a perceptual color space, it measures distances between RGB colors in CIE Lab. Since the optimization of the most distinct color set can get stuck in local maxima, it uses simulated annealing for optimization.

One nice touch is that you can plug your own random RGB color generators that feed the optimizer, to find N distinct colors in a subspace of RGB. E.g., I use it to generate distinct pastel colors in visualization of linguistic data.

https://github.com/danieldk/quzah

(I am not an expert in this topic, but I couldn't find a good Java library with solid theoretical underpinnings.)