Here's why:
* Blackbody Radiation: Stars emit light across a range of wavelengths, similar to a perfect blackbody radiator. The peak wavelength of this radiation is directly related to the star's temperature.
* Wien's Displacement Law: This law states that the peak wavelength of radiation emitted by a blackbody is inversely proportional to its temperature. So, hotter stars emit more light at shorter wavelengths (blue and white), while cooler stars emit more light at longer wavelengths (red and orange).
* Spectral Classification: Astronomers use the color of stars to classify them into spectral types. The most common system uses letters:
* O: Blue, very hot (30,000 K and above)
* B: Blue-white, hot (10,000-30,000 K)
* A: White, moderately hot (7,500-10,000 K)
* F: Yellow-white, moderately warm (6,000-7,500 K)
* G: Yellow, warm (5,200-6,000 K) - our Sun is a G-type star
* K: Orange, cool (3,500-5,200 K)
* M: Red, very cool (2,400-3,500 K)
Additional Considerations:
* Luminosity: A star's brightness (luminosity) also plays a role in determining its temperature. A very bright, red star might actually be hotter than a dimmer, yellow star.
* Spectroscopy: By analyzing the detailed spectral lines of a star's light, astronomers can get even more precise measurements of its surface temperature.
So, while a star's color provides a good first estimate, more sophisticated techniques are needed for precise temperature measurements.