TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Is there an algorithm to generate coherent color palettes?

3 pointsby shivekkhuranaabout 5 years ago
Designers come up with a collection of colors that are aesthetically pleasing.<p>Colors on electronic screens are just numbers. So by first principles, designers are in fact picking some numbers from an infinite set.<p>This selection process is certainly not random. It&#x27;s common knowledge that blue works well with red on flags.<p>My question is: can a computer come up with a color palette (ie hex codes) that will work well together?<p>Is there any literature around this topic?<p>PS: I&#x27;m working on a side project that needs to generate color palettes and I have no clue about it.<p>Thanks

4 comments

muzaniabout 5 years ago
There&#x27;s the standard color theory.<p>You look at a color wheel. Colors on the opposite side of the wheel look good. It&#x27;s just opposite (complementary), but also tertiary, and so on.<p>You can also cut out a block from a color wheel. There&#x27;s some nice examples here: <a href="https:&#x2F;&#x2F;forums.tigsource.com&#x2F;index.php?topic=25396.0" rel="nofollow">https:&#x2F;&#x2F;forums.tigsource.com&#x2F;index.php?topic=25396.0</a><p>Hex code might seem tough, better to look at it from HSL (Hue, Saturation, Lightness) and focus on only Hue.
thedevindevopsabout 5 years ago
I&#x27;m a fan of <a href="https:&#x2F;&#x2F;paletton.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;paletton.com&#x2F;</a> but someone has tried to apply AI to the problem: <a href="http:&#x2F;&#x2F;colormind.io&#x2F;" rel="nofollow">http:&#x2F;&#x2F;colormind.io&#x2F;</a> though beauty as ever remains in the eye of the beholder...
tlbabout 5 years ago
Although there are general principles, there&#x27;s no accurate theory for what looks good. But I think you could train a ML model on data, such as from <a href="https:&#x2F;&#x2F;www.colourlovers.com&#x2F;palettes" rel="nofollow">https:&#x2F;&#x2F;www.colourlovers.com&#x2F;palettes</a>.
cborensteinabout 5 years ago
I like <a href="https:&#x2F;&#x2F;coolors.co&#x2F;" rel="nofollow">https:&#x2F;&#x2F;coolors.co&#x2F;</a> for color palette generation. Not sure what their algorithm is.