Excellent explanation! I came here thinking “why use ML for this?” and this is specifically addressed:
> You might ask at this point, if we can enumerate all possible solutions like this, why not just generate colors from first principles - why is machine learning even needed? The answer is basically that translation and rotation in colorspace might be contrast-invariant, but they're not preference invariant. Humans have subjective preferences for certain color combinations over others, so to generate pleasing color combinations we need to quantify which areas in the configuration space people generally prefer.
> To quantify which color combinations graphic designers prefer, I started by scraping design thumbnails from the web.
> At this point we have a decent sized dataset to train our ML model. The overall approach is to treat the problem as conditional image generation - the color contrast graph is the input and the corresponding color palette is the output.
It's interesting to think what would happen if a tool / technique like this one became super popular. Would we see more variation, as more people could choose schemes that look good? Or would we see convergence as there are no longer people actively making decisions (similar to what may be happening in the stock market due to the rise of index funds: [1])?
You can guide the ML model by locking one or more colors, then clicking generate again. (click the circular swatch on top to lock a color)