Stars come in a wide variety of colors, sizes, and classes. So why can't there be green ones? If it is possible for them to exist, have astronomers simply not discovered them yet?
The color for stars is somewhat limited. Stars are extremely hot and they also emit light close to that of a black body emitter. Thus, they have a known profile of spectral emissions -- if you know their temperature, then you can plot their energy emission (or photon flux) for any given wavelength.
[Here is what a
blackbody (Planck distribution) looks like.]
A cool star will produce a major portion of their emissions along the red end of the visible spectrum.
A really hot star (B or O class) will produce a majority of their emissions on the blue end of the spectrum.
All the colors of the visible spectrum are emitted for not only these two types of stars, but for all stars. [Neutron "stars" aren't technically stars.]
The color distinction comes from where their peak energy levels are along the spectrum. Blue stars will have a lot of red emissions but not in comparison to their enormous blue-end of the spectrum emissions. The opposite for the red stars.
So, the problem in seeing a green star is that all the other colors (and their spectral intensities) must be taken into account so that even if they peak in the green band, their other blue, yellow, and red colors will make them appear white, in this case.
The Sun is a good example. It has a peak wavelength that is in the blue band. [Given its temperature, you will see others say it is in the green band, but that is only for a perfect black body, which isn't our Sun.] My avatar represents the true color of our Sun (if viewed above our atmosphere) as it was a direct image of it. It ain't yeller, nor blue, nor green.
Some will simply state that the reason our star is white is because it emits all the colors of the spectrum. But, as mentioned earlier, that is a very incomplete statement. The key is how much of each color is emitted (i.e. SED, Spectral Energy Distribution, though for the Sun it's actually a spectral irradiance distribution).
In the movie "KAPAX" there was also talk about purple stars. This was of course science fiction, but are those possible also?
Yep! The one exception to what I stated above comes for those stars which veer much further from a black body distribution than normal stars.
These are the coolest temperature stars. Their lower temperatures allow for a significant increase in molecular composition. Their molecules can help favor certain colors, such as marron or crimson (or purple) ...depending on what college you favor.