Let's use a simplistic metric, "best contrast". Yo...
# random
c
Let's use a simplistic metric, "best contrast". You could ask the system "Get me the color that has the best contrast against #f00". Well, "best" is subjective, obviously, and when you're trying to select a color scheme that looks but needs four distinct colors, I'm not even sure this can be solved