The portions of light which reach our eyes emitted from stars are diffracted light and not the pure one. When these beams of light reach the atmosphere they get scattered. Further, the density of the air is not uniform throughout the atmosphere, as a result the scattered beams of light reach to us of different intensity causing flashes of different colors. These flashes of different colors cause stars to appear in the sky flashing different colors.
The portions of light which reach our eyes emitted from stars are diffracted light and not the pure one. When these beams of light reach the atmosphere they get scattered. Further, the density of the air is not uniform throughout the atmosphere, as a result the scattered beams of light reach to us of different intensity causing flashes of different colors. These flashes of different colors cause stars to appear in the sky flashing different colors.
My answer is just an opinion, doesn't based on science, but on observation.
First I mention that, colors of stars are not severely different , they are derivatives of orange color. Now why those derivatives? I think it is related to size of stars, distance that they are far from "us", the age of stars, the atmosphere that their lights cross, ....
One reason that all stars appears orange, red or yellow is that red light proceeds farther due to larger wavelength which bends less than other colour of light.
I like comments by @ Haneefa and @ Mahammad which throw ample light on the reasons why stars flashes different colours.
The huge distance of the star, as well as size, for example, whenever the color of the star, such as the Blue larger the size of the sun and the more like the Red was in the size of the sun or smaller, and like the different colors whenever This shows that the star may be in the event of an explosion and science can be the star had burst or does not exist, but the light is still traveling to after Almavh between him and the ground, and God created the Public
Reading the answers of my expert colleagues, it seems to me that it is just an effect produced by the atmosphere. Does the temperature (or any other physical condition) of the star play no role at all?
Stars produce different colors mainly due to surface their temperatures; twinkling occurs due to refraction of their light rays through the atmosphere.
The temperature cause is called Wien's Displacement Law. According to this the wavelength emitted by a hot body (here, star) is inversely proportional to its temperature (in Kelvins). So, a relatively cooler body will look more red while a relatively hotter body will shine in blue wavelength.
This is how the surface temperatures of all visible stars including the Sun have been estimated.
The stars in the sky that we can observe directely and are more related with our planet earth are the sun and the moon. The rainbow tells us how the sun light can be decomposed into a magnitude of colors. Moon light is the theme of music and poetry.
stars' colors above atmosphere are (almost) static in time (at an hour scale). In a static atmosphere stars' colors are almost static, also. A disturbed sky flashes the colors in time of a second scale. Enhanced flashes occur at windy nights with high humidity. Try to see stars' colors near an airplane line zone at a non windy night (but with high humidity). Old sailors were afraid for the next days when stars' colors showed enhanced flashes.