Colors on electronic screens are just numbers. So by first principles, designers are in fact picking some numbers from an infinite set.
This selection process is certainly not random. It's common knowledge that blue works well with red on flags.
My question is: can a computer come up with a color palette (ie hex codes) that will work well together?
Is there any literature around this topic?
PS: I'm working on a side project that needs to generate color palettes and I have no clue about it.
Thanks
You look at a color wheel. Colors on the opposite side of the wheel look good. It's just opposite (complementary), but also tertiary, and so on.
You can also cut out a block from a color wheel. There's some nice examples here: https://forums.tigsource.com/index.php?topic=25396.0
Hex code might seem tough, better to look at it from HSL (Hue, Saturation, Lightness) and focus on only Hue.