3 ms·
Picking Colors Optimally: An Optimization Problem in Python
- lutusp 14y agoThe article's method contrasts colors based on the numerical separation of their RGB values. Unfortunately, human color perception doesn't necessarily follow this model. There are some color pairs that would be judged very far apart by this method, but that a human won't necessarily perceive as contrasting. Also, there's the issue of size. Medium-sized adjacent objects are perceived as having more contrast than large or small ones: http://en.wikipedia.org/wiki/Contrast_(vision)#Contrast_sensitivity http://en.wikipedia.org/wiki/Contrast_(vision)#Contrast_sens... So this is a more complex problem than simply choosing colors by number.
- beala 14y agoYou're absolutely right! :) It would be interesting if someone could extend this to look at how different color representations affect the results, such as using HSL rather than RGB. I tried to factor out the getSuccessors function and evalSuccessor as much as possible to make this kind of experimentation easy.
- 1331 14y agoThere are many programs that algorithmically generate palettes based on the HSV color space. Note that since complementary colors are calculated by hue alone (a single dimension), there is no need for optimization. Here is a web-app that I use often: http://colorschemedesigner.com/ http://colorschemedesigner.com/