# Compare temperature of two colors

Given values a and b in the appropriate color space, does perceptual psychology provide an algorithm to determine which is cooler and which is warmer? Even better, is it possible to determine how much warmer the warmer color is?

To resolve confusion, understand that there are two kinds of "color temperature": physical ("scientific") color temperature and artists' color temperature. I am writing software to aid digital painters, so I am concerned with the latter.

Physical or Scientific Color Temperature

This is the mapping between light sources' hues and Kelvin temperature values. It is based on a canonical curve in chromaticity space defined by the color of the light emitted by a black-body radiator as its temperature increases. The mapping from Kelvin to color is trivial via a priori knowledge of this canonical curve.

Mapping from color to Kelvin is harder, requiring the approximate determination of "closest correlating temperatures". Given a light source with known color and unknown color temperature, one finds the nearest point on the canonical black-body radiation curve and chooses the associated Kelvin value.

In brief, physical or "scientific" color temperature is just about assigning Kelvin values to light sources. For more information, see http://en.wikipedia.org/wiki/Color_temperature.

Artists' Color Temperature

Artists' color temperature is arcane, intuitive, and weakly explained in almost all the literature I have encountered (the notable exception being Bruce MacEvoy's online article, which I mention in my answer below). The ambiguous nature of artists' color temperature probably owes to an anti-scientific cultural vein among contemporary illustrators.

The best I can explain is that illustrators generally believe colors like blue and green to be cool and colors like yellow and red to be warm. With practice, artists learn to see temperature differences between colors. Success in representational art depends on being able to see temperature relationships and mimic them with paint. For instance, in portrait painting, an artist needs the facility to make observations like, "Ah, the shadow side of my model's cheek looks warmer than the tip of her nose. I need to make sure that the paint I use to represent her nose has less yellow/red in it than the paint I use to represent the shadow side of her cheek".

I hope it is clear that physical color temperature may or may not be orthogonal to artists' color temperature. They are principles taken from communities with almost a null intersection. Part of the reason I asked this question was to find out if the two definitions of color temperature can, in fact, be treated interchangeably.

-
possibly related to nature.... – Muhammad Umer Apr 25 '14 at 18:44
I'm not clear what you're asking. What is "Illustrator's Color Temperature" and how does it differ from Scientific Color Temperature? – Ryan May 19 '14 at 20:57
@Ryan: When I say "scientific color temperature", I refer to the color temperature of light sources, as described at [link] (en.wikipedia.org/wiki/Color_temperature). In scientific color temperature, hues are associated with literal temperature values in Kelvins. – phizla May 20 '14 at 17:32
@Ryan: Artistic color temperature, on the other hand, is the ambiguous aesthetic of juxtaposing supposedly "warmer" or "cooler" colors as per handprint.com/HP/WCL/color12.html. – phizla May 20 '14 at 17:39
Those two comments do not provide any clarification or new information. In your own words could you better explain the differences is and what you're asking? – Ryan May 20 '14 at 17:59

There is no way of measuring artist's color temperature as it is entirely relative. What colors are "warm" and "cool" depend entirely upon which colors they are juxtaposed against. In fact, many famous artists are known for their mastery of unexpected color combinations; Mark Rothko and Vincent van Gogh are two off the top of my head.

You can see this in Van Gogh's The Night Café. The red walls become one of the cooler colors in the painting when compared to the garish yellows and greens in the foreground.

However, if you aren't really looking for a formula but a rule of thumb, "blue is cool, orange is warm" seems to be the go-to. I believe this has something to do with the scattering of light in the atmosphere that makes sunlight yellow and the sky blue. This would mean that areas that are in shadow wouldn't reflect any yellow light from the sun, but would still get the ambient blue light from the sky. Everyone seems to have a different theory about this though, so take mine for what you will.

-

Interesting question, so you are suggesting spatial color range. I think the larger the wavelength the longer the distance you can still see the light emission - red has a bigger wavelength this means you will be able to see it when the blue light goes out, I think simulating renders with a 3D software would help you understand what you are looking for

http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/

Light Spectrum

-
A physically based mapping from temperature to RGB is insufficient here. The reverse mapping would be effective except that no natural model provides it. The scientific models can only deal with the the colors produced by incandescence in nature. They cannot say anything about whether, say (0,125,255) is warmer than (0,255,50). – phizla Apr 28 '14 at 15:33

The best source I have found is Bruce MacEvoy's in-depth treatment at http://www.handprint.com/HP/WCL/color12.html. This article seems to suggest multiple methods for gauging relative color temperatures. For instance, MacEvoy describes a "distance in a color wheel" approach, which to me suggests comparing Euclidean distances in hue-saturation space to arbitrarily chosen warmestColor and coolestColor positions. However, he warns that such an approach is not always appropriate, and may in certain contexts be superseded by simple comparison of yellow/blue opponent channel values.

-