Human eyes can see wavelengths of electromagnetic radiation between 390 and 750nm. Light at the long end of this range (~750nm) appears red while light at the short end (~390nm) appears blue or violet. We call this range the visible spectrum for pretty obvious reasons; it’s the wavelengths of light that are visible to our eyes. To our anthropocentric (=totally human-oriented, selfish) dismay, the universe doesn’t only emit radiation at these wavelengths, so we can’t see everything that there is to see. But, to our anthropocentric delight, we have invented instruments that can detect pretty much any wavelength of radiation and we’ve been using this to our advantage ever since.
Stars, like the big ball of flaming Hydrogen sitting 1.5 million kilometers above our heads, emit light across the spectrum of electromagnetic radiation. They do not treat all wavelengths equally, however. The wavelengths emitted by stars depend on two main factors: temperature and elemental composition. Stars act as black bodies, emitting a specific wavelengths of light based on their temperatures. Hot stars have lots of energy, so they will emit shorter (bluer) wavelengths. Cooler (relatively, remember that the absolute coolest star ever discovered, a brown dwarf named WISE 1828+2650 is still 300K, a nice hot summer’s day) stars will emit longer (redder) wavelengths. The other type of radiation is due to the elements present in the star. Every element in the periodic table has a characteristic set of emission lines based on the energy levels of their electrons. After the electrons are excited, when they drop back down to their ground state, they emit a particular wavelength of light. The combination of these two factors means that every star will emit light of many wavelengths, but will have a dominant colour. This is how we classify stars.
Most astronomers agree that there are 10 different stellar classes, listed here in order of decreasing temperature, O, B, A, F, G, K, M, L, T, and Y. O stars are blue, F stars are white, and L stars are red. “But wait a minute!”, you may be saying to yourself, “I thought the rainbow went ROY G BIV: Red, Orange, Yellow, Green, Blue, Indigo, Violet. Why do stars go blue, white, red? Where’s the green!?” It turns out that the light emitted from a star is actually in a somewhat normal distribution, peaking at certain wavelengths. Red stars appear red because their peak is on the red end of the visible spectrum and we can’t see the part that appears in the infrared. Blue stars appear blue because the part of their light curve that falls in the invisible ultraviolet range. Stars whose wavelength peaks at green appear white because we see a little bit of all the different wavelengths of light.
So there are no green stars out there. At least the stars that would be green appear white to us, but that’s just a trick of the human eye. I am reminded again of my anthropocentrism. The star isn’t green or white or anything else besides a star. It doesn’t care what we call it. It is useful and sometimes fun to think about coloured stars and to fit the universe to our models. I don’t mean to insinuate that it’s wrong or bad to be anthropocentric in this case, it’s the only thing we can be. We are human and so we must look at the world as such: with human eyes and human brains.