I will be generating charts and diagrams and I am looking for some theory on color schemes and algorithm examples.Example questions:How to generate complementary or analogous colors?How to generate pastel, cold and warm colors?How to generate any number of random but distinct colors?How to translate all that to the hex triplet (web color)?My implementation will be in AS3 but any examples in pseudocode are welcome.
Color schemes generation - theory and algorithms
algorithms;theory;color
In looking for more information about this question (it's something I've struggled with also) I found this blog.  Stefano Mazzocchi explains his theory on why programmers suck at picking colors for UI design and offers some helpful advice and links.The first bit of advice he offers is this obvious fact that lays the foundation for picking hues and saturations:Two pieces of information with the  same contrast against their background  will be perceived at the same  importance level (all other things  being equal), while more contrast  identifies more importance and less  contrast identifies less importance.This offers the first clue as to how to pick colors for foreground and background--less important information should use lower contrast and more important information should use higher contrast.The first link is to Color Scheme Designer, a site similar to Kuler.  Like Kuler, it's a handy interactive tool, but it doesn't offer any insight to how colors should be picked, i.e. which yellows work with which greens or blues, etc.The next link he offers is to a NASA Color Usage Research Lab web site entitled Using Color in Information Display Graphics.  This site provide a lot more information about how to pick colors for proper contrast, etc., and lists the mathematical formulas for measuring things like contrast.  I haven't found any SW code or pseudo code algorithms on that site yet, but I've only looked at a few pages.  Stefano also points out that the NASA Color Lab uses the Munsell Color System, a system similar to HSV but weighted to more accurately reflect human perception of color rather than measurable properties of color.One last link mentioned in Stefano's blog is to a site called Color Trends + Palettes::COLOURlovers.  This site offers no more help in finding an algorithm for picking colors than Color Scheme Designer or Kuler, but it emphasizes the less measurable quality of current changes in our fleeting enjoyment of certain colors and palettes.  It's worth a visit if you want your UI to reflect the latest trends.Once again, check out the NASA website and read through some of the pages there, especially those on Color Science, and you should be able to come up with a workable algorithm for picking colors that work together and provide the desired contrast.EDIT:I'll add additional helpful links in this area as I find them.Interactive Genetic Algorithm for Colors.pdfA Perceptual Color Segmentation Algorithm.pdfA Guide to Combining colors and color Schemes for Great Web Design.html