What color are stars?

I know that the sun looks white to us because it emits a large variety of color, making it appear white to our eyes but does this mean that all stars emit a variety of light? If so, then how can we know the temperature of the star (relating to it's color)?

I think that you should first read some of the answers to the question Why do metals only glow red, yellow and white and not through the full range of the spectrum? which explains the colours that we observe when viewing hot objects.

So although stars emit a range of wavelengths they do not all appear to be white because the colour of a star depends how much of each wavelength it emits which depends on the surface temperature of the star.

So Betelgeuseis a relatively cold star with a surface temperature of approximately $3,500\, \rm K$ and when observed from the Earth appaers to be red whereas Rigel with a surface temperature of approximately $11,000\, \rm K$ is seen as a bluish white star.

When star light is viewed from the Earth's surface the atmosphere complicates matters as does the absorption of certain wavelengths in the upper atmosphere of the stars however to a reasonable approximation one can say that the radiation (not just visible light but also infra-red, ultra-violet etc) emitted by a star is the same as that emitted by an idealised hot body called a black body.

The variation of light intensity as a function of wavelength is show below but not that in this graph the wavelength decreases as one moves to the right on the wavelength axis.

The "fit" for the the Sun's spectrum (red) compared to a black body at about $5,800 \, \rm K$ (orange) is shown below again wavelength is decreasing to the right where wave number is $\frac {1}{\rm wavelength}$.

Notice that the peak of the spectrum moves towards a smaller wavelength as the temperature increases.

For black bodies there is a relationship between the wavelength of the peak in nanometres ($10^{-9}\,\rm m$) and the temperature in kelvin called Wein's law.

$$\rm temperature\, (K) = \frac{2897000 \,\rm (K\,nm)}{\rm wavelength \,(nm)}$$

So by finding the value of the wavelength at the peak of the spectrum from a star one can estimates its surface temperature.

Here is one for you to try with a linear wavelength scale which comes Page 55 of NASA Space Math V and the answer is on Page 56.

but does this mean that all stars emit a variety of light?

Yes. All objects emit a spectrum of radiation, dependent on their materials and temperature. If the temperature is high enough, some of the emission will be in the visible band.

If so, then how can we know the temperature of the star (relating to it's color)?

While the sun emits radiation of different colors, the power of each is not the same. This spectrum changes as the temperature changes.

Our eyes are able to discern large shift in this spectrum. A very cool star appears red, a very hot star appears blue. But by using more sensitive instruments, fine differences in the spectrum can be recorded, which correspond to relatively small differences in temperature.

The stars we can see and study with telescopes emit a variety of colors of light. But because they are predominantly made up of the same substances, the colors they possess are well-accounted for by differences in their surface temperatures. In this regard, they all display the same well-known correlation between temperature and color that all hot objects possess. This allows astronomers to determine the temperature of the star fairly accurately, even if it is extremely far away from us.

• @safesphere, I purposely tailored my answer to the background level I perceived in the OP's question. Kindergarten was 60 years ago for me but to the best of my recollection I was not taught anything at all back then about the relationship between the blackbody spectrum and the color of a star. You might think that a downvote was "well deserved" in this instance but I would submit that even if this was true, there would be literally dozens of different ways to convey that particular sentiment to me in this public place which would not be nearly so insulting. – niels nielsen Jun 2 '18 at 0:07
• I didn't downvote. Many people other than the OP read answers here. You can always split the answer into simpler and more advanced parts if you prefer, but an answer that just rephrases the question without actually answering it is not worth posting. Sorry for the earlier comment, no harm intended. I've deleted it. – safesphere Jun 2 '18 at 0:13