All hot objects emit
radiation – the colour of that radiation depends on the temperature of the object. For example
a hot (say 200oC) object will emit mostly infrared radiation while one at 1000oC will emit a lot
of visible radiation as well.
There are laws of thermal radiation emission that give
the exact distribution of energy across the spectrum – that is how much energy will be
radiated at different wavelengths (colour regions) at different temperatures. If you are really
interested look up Wien's Law in a Physics book (its on this site of course and I will add an
extract from the text part of the site for you.
If the peak of the energy-wavelength
curve for a black body lies in the red region of the spectrum the body will appear red hot, and
as it gets hotter this peak will move towards the violet end of the spectrum. However this
does not mean that the body will look "violet hot". The reason for this is that at the higher
temperature all visible wavelengths will be present to some extent and so the body will
appear "white hot". A white-hot body will give high emission across the whole range of the
visible spectrum.
If we know the value of the maximum of the curve for one black
body at a known temperature we can use Wein's law to calculate the temperature of another
black body providing the wavelength at which maximum energy is emitted is known. This has
been used extensively in astronomy for finding the temperatures of stars.
Stars like
our Sun are very average, they have a maximum in the green region of the spectrum and a
surface temperature of around 6000oC compared with white-hot stars like Sirius or Rigel with
surface temperatures of more than 30 000oC.
The colour of the stars will be virtually
unaffected if you go outside the Earth's atmosphere, although they will be brighter - no
atmospheric absorption or scattering of the light.