I'm thinking of making a world where the sky is purple, or at least perceived as purple by the native species taking centre stage in my story.
What gases could cause this colour? Could the colour have anything to do with Rayleigh scattering?
The sky looks blue to us because of two major factors:
There are also a number of other factors including atmospheric temperature and pressure, but they have a lesser effect - they only inflict small changes on the other major effects.
The composition of the atmosphere affects the colour of the sky by refracting, reflecting, and deflecting the Sun's light. Each chemical compound in the atmosphere refracts light differently; on Earth it is just the case that blue light gets refracted the most. The more a colour of light gets refracted, the more of it there appears to be in the sky (because it's spread out), so it becomes the color we see in the sky.
Let us be clear on this point: the colours of the compounds themselves has no effect. Unless there is such a huge amount of a compound as to be clearly visible to the human eye, the colour of any molecule doesn't affect the colour of the sky. There is chlorine gas in our atmosphere; the sky doesn't appear green.
For the sky to have any colour, there has to be some light. If there is no light, the atmospheric compounds cannot refract it and create colour. This is clearly demonstrated on Earth: at night, the sky is dark - because there is no light coming through the atmosphere to get refracted.
The hue of the light also has an effect. If, for example, the Sun didn't output any blue light, the sky would not be blue because there would be no blue light to refract. The hues of the refracted light mix together to create the colour of the sky - if red and yellow are refracted most, you will end up with an orange sky.
To change the colour of the sky on your world, simply change the light that's hitting the atmosphere, or change the atmospheric composition. The atmosphere's total refractive index is what determines what light is refracted most. The Earth's refractive index is close to 1: if it increased, the sky would tend towards the red end of the spectrum; if it decreased we'd tend towards ultraviolet.
I'd recommend reading this physics.stackexchange post. https://physics.stackexchange.com/questions/28895/why-is-the-sky-not-purple . Based on Rayleigh scattering, violet light, which has the shortest wavelength, is the dominant color. However, there is enough of other frequencies that we perceive the sky as blue.
The solution is then simple. Give your natives better eyes, instead of trying to change the physics. Rather than detecting the average color, let your native's eyes determine each color light that is seen. Human ears already have this advantage, being able to tell the difference between a single note being played and a chord being played.
I have a landscape photo that I made into a poster, that has a vivid vilot sky. It was shot with a polarizer, looking upward at a figure on top of a peak.
Your alien, like some species on Earth, could have polarized vision. There is no reason to believe that an alien (or a bird for that matter) would have a "color wheel" that connects the two ends. The "purple line" in a CIE diagram is non-spectral and exist only as human perception— you might think of them as analagous to chords in music.
So does purple mean some mixtue of red and blue (magenta), or does it mean a spectral frequency at the high end (only)? Why would an alien have colors as perceptions like us? Orange is a different perception than green, but that's just us. Which points or chords give distinct perceptions to the alien is any body's guess. It does stand to reason that the ends would be distinct, so violet would exist as the highest notes that can be detected.
Note that I distingish the pure frequency vilot from the perceptual color purple.
How high does the alien's vision go? The sky's scattering may be around the highest frequency he can detect, and a bit distanced from most other natural colors in his environment. The visual system appears to be extended upward specifically to sense the sky. In that case, it would have a distinct perception, and we would colloquially translate his experience (the pure color with the highest frequency) as vilot.
If the planet orbits a star that gives off red light (they have those, right?), or perhaps has a large satellite that reflects red light, the sky might appear purple. Constant volcanic activity, fires, or oceans full of algae that reflect red light combined with a bright sun and a thick atmosphere could cause a violet-shade sky. Because Rayleigh Scattering doesn't really depend on the specific chemical that the light is being scattered through, the only way to achieve purple would be to have an inordinate amount of local red light or red-reflecting stuff. I don't know if oxidized iron can float around in clouds, but if it could that would make for some purple skies.
Linguistically, it's conceivable that the culture would have a word that corresponded to "blue-purple" instead of the more usual "blue-green," so that they don't differentiate between blue and purple, but the sky would still look blue to us. I recommend checking out color terms in various languages: They very cool.
Here's an idea: If you had a high amount of neon in the atmosphere and constant storms, the sky would appear blue and purple as neon plasma is reddish in hue.
I think a little amount of trifluoromethyl nitrite or bis (trifluoromethyl) nitroxyl in atmosphere could make it look purple. Also the eyes of the inhabitants could contain receptors which are more sensitive to purple than blue.
Purple is a difficult color. It has short and long wavelengths and is short in the middle. A star can't really have two different narrow spectra at the same time and gasses usually adsorb relatively narrow bands.
It is relatively easy to tweak the visual receptors so that sky looks purple. Most animals see the colors differently from how we see them since the visual system adapts to see what is important for survival of the species. So different diet and habitat usually result in different colors.
If the planet is artificially terraformed by some ancient civilization and was originally too hot, the ancients might have cooled it by adding dust that absorbs a relatively wide band of the middle wavelengths. This might result in a purple sky. It would also imply some huge alien machines in space maintaining the "shroud".
Purple is surprisingly hard to get naturally at human survivable temperatures:
Iodine is purple gas at temperatures over 185°C (363.7 °F). Unfortunately, Iodine forms compounds with just about everything, many of which are solid or non-purple.
Rayleigh scattering could cause distant objects to look purple, especially if there is a gas in the atmosphere that scatters green light and some blue light1. I don't know of any gas that does this at a human survivable temperature.
The native species might perceive blue as purple if they have a red-green colour blindness (src) which would make them confuse certain blues and purples. This has other side effects though, mainly being colour blind.
Lightning can (briefly) light up the whole sky (clouds in particular) in purple, green, or blue. This might not be what you're looking for.
1. Not sure if there is such a gas, or if I have correctly understood Rayleigh scattering there.
Your planet's sun is expelling a planetary nebula.
These clouds of superheated gas glow according to the emission spectrum of the cloud component atoms. Argon is a good purple. The cloud is actually a sort of super solar wind as I understand it, and so would stream around and past your planet.
The sky would be brighter purple at night. It might be very bright at night.
Make your planet's inhabitants colorblind due to some genetic condition. Colorblind people with the deuteranomaly type of colorblindness already see our Earth's sky as violet. And the fact is... our sky IS violet! Check this out: https://www.forbes.com/sites/briankoberlein/2017/01/11/earths-skies-are-violet-we-just-see-them-as-blue/#68bb7df7735f
It seems to me the simplest way would simply to have a thinner atmosphere on the planet.
If you look at a blue sky it shades from pale blue near the horizon to dark blue near the zenith because of the different atmospheric distances that light has to travel. The farther light travels through the atmosphere, the more it is scattered and the lighter the sky in that direction looks.
Making the atmosphere a bit thinner but still thick enough to breath should make the sky a darker blue and thus closer to purple.
Then you would need to add a lot of red light so that the sky turns from deep blue to purple. Suppose that a lot of land plants and water plants are red. Then the sun shining on the plants would be reflected up to the clouds and down from the clouds as reddish light, mingling with the dark blue of the sky to look purplish.
Sunrises and sunsets are often pink and purple. So maybe the habitable zones of your planet have perpetual sunrise/sunset conditions and perpetual purple skies.
If your planet orbits a dim red dwarf spectral class M star, in order to be warm enough to be habitable it will probably have to orbit so close to the star that tidal forces will tidally lock the planet. slowing the planet's rotation rate so that a planetary day equals a planetary year. Considering how close the planet would have to be to the red dwarf star and how short it's year would have to be, such a slow down would not be as much as slowing Earth's day to a year.
Once the planet's rotation rate is slowed so that a day equals a year, one side of the planet will be in perpetual daylight and heat up greatly, and one side of the planet will face away from the star in perpetual night, and will cool off.
It is possible the air and water from the hot side will all flow to the cold side and freeze solid, leaving the planet airless and uninhabitable. But possibly the atmosphere and hydrosphere will transfer enough heat from the hot side to the cold side to keep the atmosphere and water from freezing on the cold side. In that case the twilight zone between the hot side and the cold side may be the only part of the planet with the right temperature for life.
In the twilight zone the red star will be at the horizon. The red star's light will contain many different frequencies of visible light, and should have enough blue light for atmospheric scattering to make the sky dark blue. But the vast amount of red light from the red star should also cause a lot of red light to be scattered by the sky, perhaps making the sky appear purplish.