What circumstances would need to be in place for the sky to be a different color?

Say, the color red, or green. Would it always have to be a primary color? Would the diameter of the earth make a difference? Just wondering.

The composition of the atmosphere would have to change radically, rather than any size changes. The sky is blue primarily because of Rayleigh Scattering of sunlight off air molecules, with some contribution from dust and other particulate matter suspended in the atmosphere.

There’s no reason why the sky would have to be a primary colour, but would depend on what gases were present in the atmosphere. The sky on Mars is yellow in the daytime because of suspended dust particles.

Well, the sky gets its blue colour essentially because of Rayleigh scattering (which I on preview see have been beaten to mention), which is scattering (of light) on small particles (particles whose size is considerably smaller than the wavelength of light) – the gist of it is that the scattering cross section varies with the inverse of the fourth power of the wavelength; meaning, short wavelengths get scattered more (primary colours don’t really play into this, btw – white light consists of all colours, so you could in theory get every colour out of it).

Thus, the longer the way of a beam of light through the atmosphere, the higher the likelihood that the blue portion gets ‘scattered away’, which is why we see light emanating from places in the sky without a light source (i.e. the sun – if there were no scattering, all the light that doesn’t hit our retinas directly coming from the sun would simply not reach us).

To get the sky – or at least a significant portion of it – to look red, you can simply increase the distance a light ray has to travel; on average, the red portion will be scattered later than the blue portion, meaning more red will reach our eyes (which is why, for example, the sunset/rise appears red). So, for a redder sky, increase the thickness of the atmosphere (which would, incidentally, imply increasing the radius – and thereby mass – of the earth in order to get enough gravity for all that gas to stick around; other than that, the earth’s radius doesn’t play any role in the whole deal, though). Of course, the heightened pressure and gravity would then make the earth a pretty inhospitable place, but hey, you can’t have everything.

Alternatively, you could introduce some gases into the atmosphere that absorb a specific portion of the visible spectrum, leaving only certain colours – things would be a bit dimmer, though. And there are not really many coloured gases, mainly because, with gas molecules being comparatively few and far between in a given volume (as compared to solids or fluids), each individual molecule would have to absorb quite a lot of light to create a noticeable effect. And most of those gases would probably be more dense than air, leading to a bit of suffocation going on on the ground. If they’re not outright toxic. Actually, the only coloured gas I can think of right now that’s in its gaseous phase at room temperature is chlorine, which is both denser than air and toxic. So, well, we should probably stay away from that whole dying the atmosphere thing.

It frequently happens that particulate matter gets suspended in the air that alters the scattering cross section of the air. This typically happens after large fiorest fires, which leave lots of organic oils in the air in the form of spherical droplets. These can skew the scattering so that you don’t get most of your scatter in the blue. This is what can cause blue suns or green suns (or green or blue moons – they really do occur). See van de Hulst’s book on Light Scattering, and references therein.

See also Once in a blue moon. Stephen R WILK Optics and photonics news
17:33, 20-21, Optical Society of America, 2006.

Of course, just about every evening at sunset you get different colors in the sky, as the scattered light is light thast’s already had the blue scattered out of it, resulting in a red sky. At the moment of the Green Flash you have a green sun, and probably a green sky as well.

Heck, I get grey skies al the time when there are clouds.

There’s also fluorine, which is worse. It’s not only toxic but explosively corrosive.

Yeah, but don’t tell me you’re just taking that guy’s word for it ;).

It’s already been mentioned that primary colours don’t have anything to do with the question. However, it seems to me that there is a lot of confusion as to what the primary colours are all about, so I’ll add the following: Primary colours result entirely from the structure of the human eye. There are three primary colours because you have three different kinds of cone cells in your retina and each type is sensitive to a particular region of the electromagnetic spectrum. Thus, with only three wavelengths you can stimulate each type of cell and fool your eye into perceiving all the colours it can see. It just so happens that you perceive these three wavelengths as red, green and blue. If you were a dog, you would need only two primary colours. If you were a mantis shrimp, you would need as many as 12 primary colours.

More technically, the three types of cone cells are called S, M and L and the regions of the spectrum they are sensitive to overlap. If I shine a light with a wavelength of 680nm, the L cells are going to react the most strongly and you’ll see red. If I shine a light at 545nm, the M cells are going to react the most and you’ll see green. If the light has a wavelength of 575nm, both M and L cells will react about equally and you’ll see yellow. However, I can also stimulate M and L cells equally by shining light at both 680nm and 545nm simultaneously. Although, physically this will be a very different spectrum than just a single wavelength, perceptually, a human won’t be able to tell the difference. A mantis shrimp probably would, though.

This is a common misconception. With only three colors you can only produce a limited gamut within the color space that the human eye can see. There is literally no way for an RGB display to produce violet, but your eye can distinguish it as a distinct color.

The reality is that you can use all sorts of sets of colors as primaries. If you are limited to three primaries, then RGB is your best bet.

Somehow I knew someone was going to point this out and I still wrote “all the colours” instead of “most of the colours”. Using common additive processes, such as sRGB or Adobe RGB, it’s true that you can only fake part of the visible colours. However, CIE XYZ or CIE LAB cover pretty much all of the visible gamut, and they are also 3-dimensional spaces. You need at least 3 parameters to define a colour because you have three kinds of wavelength-sensitive photoreceptors.

Now, if you get into the details, it’s a bit more complicated because you also have rod cells and they also play a part in how a colour is perceived. And of course, there is colour-blindness and possibly also human tetrachromacy.

Anyway: primary colours have nothing to do with the properties of light, it’s all in your eyes.

How do we see violet, then? It seems contradictory with the concept of us having only three kinds of cones.

The colors we see can be reduced to three tristimulus values, but there is no way to “dial in” these values using light because there is no way to stimulate each cone independently. For example, the green cone always overlaps with the red or the blue cone and sometimes both. Also, the response of the red cone has two peaks one of which is well into the blue.

It can get pretty complicated, and I continue to muddle through it myself. The wiki on the CIE 1931 color space is a good place to start if you want to get into the science of color. Your monitor probably only covers a fraction of that color space.