Basic Astronomy and the Nighttime Sky
As objects grow hotter, they radiate energy dominated by shorter wavelengths, changing color before our eyes. A flame on a blow torch shifts from reddish to bluish in color as it is adjusted to burn hotter. In the same way, the color of stars tells scientists about their temperature.
Our Sun produces more yellow (and green) light than any other color because its surface temperature is about 5800 K. If the Sun's surface were cooler — say 3,000 K — it would look reddish, like the star Betelgeuse. If the Sun were hotter — say, 12,000 K — it would look blue, like the star Rigel.
Much-cooler objects, like items at room temperature (20° C, or about 300 K), would not produce visible light but would emit in the infrared. Note that cooler objects have overall lower emission at all wavelengths than hotter ones — even at their peak wavelengths.
A perfect blackbody is an ideal theoretical construct, and objects like stars and animals only approximate blackbodies, but the approximation is generally good in many cases.
See also:
Thanks to:
National Aeronautics and Space Administration, Science Mission Directorate. (2010). Introduction to The Electromagnetic Spectrum. Retrieved January 12, 2014, from Mission:Science website: https://science.nasa.gov/ems/01_intro
National Aeronautics and Space Administration, Science Mission Directorate. (2010). Visible Light. Retrieved January 12, 2014, from Mission:Science website: http://science.nasa.gov/ems/09_visiblelight