How can we tell the temperature of a distant star? it turns out that there is a relationship between the color of a star and it’s temperature that is called Wien’s law. The wavelength of light at which a star most strongly emits is inversely proportional to the temperature.
(The Great Courses – The Life and Death of Stars)