The technical term to search is "color constancy". There is a very elegant example at http://persci.mit.edu/gallery/checkershadow
Let's be here serious. What Les Olson said here and in the Pixel Shift thread is correct. However, I would not call it "color constancy" but Color Balance or Color Harmony in the sense of achieving the totality of an image stimulus.
Without going into a full fledged tech discussion on colour, the white balance part of it used by in camera software or digital software plays with the Brightness side of color v Hue and Saturation. In other words, it does not matter as the final judge is your own eyes. Perception is key and in camera alone cannot achieve it and white balance is the poor man solution.
When it comes to White Balance, I would not give a monkey at shooting stage unless I am shooting technical where things get tricky and we have been doing our colour correction using calibrated Sony Gamma monitors and VectorScope. Today if you are serious about colour, Photoshop levels and cureves and whatnot simply do not cut it. I appreciate entirely that the cost of a gamma monitor and vectorscope is beyond the needs and the means of run of the mill photography. We use it strictly for commercial shoots where colour harmony is critical. I also use it for standard shoots in case I am sitting in front of the station.
To summarize, White balance is as irrelevant as whatnot and camera manuf did not have any choice but come up with this one and Photoshop came up with curves which means reliying on your eyes with no reference hence the need to use a gamma monitor or you are toast.
I reiterate, Gamma stuff is for very high end and the world continues to revolve without it. As for white balance, it is a stop gap as whatever you do. it is only your eyes who are the judge as everything you do is perceptual!
How many of you changed the gamma in their Photoshop application and their colour settings and without being pedantic, do you know why and how you should change the settings. 99% of users simply accept Photoshop crap defaults.
Which brings me to another subject related to Photoshop. Do you have the correct Photoshop settings. Nowhere and nobody will ever reveal their settings.