Thursday, 14 December, 2006

Creating Color Schemes

I've mentioned a time or two before that I don't understand how some web page designers pick their color schemes.  Red text on a black background--which I see distressingly often--is almost impossible to read.  Some people seem to take perverse enjoyment in selecting color combinations that are painful to the eye.  I, on the other hand, know that I'm terrible at picking colors, so I tend to stay with simple defaults like black text on a white background, with blue for highlighting.  I'm more about content, anyway, so as long as my site is readable, I don't need too much flashy stuff.

Except when I do.  If I'm building a site or an application that requires some visual appeal I find myself frustrated at my incompetence.  Picking from standard colors or trying to make my own is hair tearing and mind numbing work.  I usually throw up my hands in frustration and go try to steal somebody else's color scheme.

What surprises me is that there doesn't appear to be a program that will generate a good color scheme for you.  It seems like you should be able to give a program some basic information about preferred background and foreground colors, and it could generate colors for links, visited links, headings, text, and all the other things that normal web pages have.  It should even be able to generate text fonts and styles, colors for menu bars--everything.

The idea of such an application is not far-fetched.  Color matching is quantifiable.  We know how colors appear to the human eye and that certain ranges of colors clash with or complement others.  And there are countless visually appealing layouts from which to choose.  It should be almost trivial to provide a theme selector and a couple of sliders that would vary the different colors in unison and preventing the color scheme from straying too far into ugly land.  Of course, such a program would require some way for the user to set specific colors for individual items, but most users wouldn't need it.

I could envision a slightly smarter version of that program analyzing the colors in a company logo image and automatically generating a complete color scheme.  Why not?

Absent a program to generate colors for me, I've recently found that creating visually appealing color sets is much easier using Hue, Saturation, and Brightness (HSB) than with the old standby Red, Green, Blue (RGB).  The reason is simple:  HSB is much closer to the way that the human eye sees color.  RGB is very close to the way that computer hardware represents color.  With HSB, a slight change in any one of the values results in a slight change to our perception of the value.  This is not the case with RGB, where a small change to one value can have a very large and quite mystifying visual effect on the on the color.

If you're interested, check out John Shemitz's article, Color Theory for Developers, which is a brief but reasonably thorough introduction to the topic.

I might experiment a bit with creating such a program as I've described.  The required information is out there waiting for somebody to gather together.  I wouldn't get rich with it, but it'd be a nice thing to give away.  Perhaps it would save me some eye strain.