Here's why:
* Blackbody Radiation: Stars emit light like a blackbody, meaning the peak wavelength of their emitted light is directly related to their surface temperature.
* Color and Temperature: Hotter stars emit more blue light, while cooler stars emit more red light. This is because the peak wavelength of their radiation shifts towards shorter (bluer) wavelengths as temperature increases.
Therefore, by observing the color of a star, astronomers can estimate its surface temperature quite accurately.