If you define colour in terms of what the human eye sees, there are only three of them, four if you count luminosity that's not in any of the three color categories, or throw in tetrochromacy; five if you count both. So yellow, for instance, is not a color if you define it this way. It's a combination of colours (specifically, red and green), or else it's a pigment that absorbs a certain color (blue).

And yeah, the output of the sun is pretty well continuous across the electromagnetic spectrum, so if you define colors as wavelengths of electromagnetic radiation then the cardinality of the set of all colours in the rainbow is aleph-sub-one, the same as the cardinality of the set of all real numbers. I suppose that means the number of colors in the rainbow is actually greater than infinity, if you define infinity in the usual gradeschool way (which comes out in math as aleph-sub-naught, the cardinality of the set of natural counting numbers).

If you define colour in terms of what the human eye sees, there are only three of them

I think you're misconstruing me! I am limiting colours to be 'things which humans can see' which doesn't correspond to 'the specific frequency ranges which stimulate only one cone type'. (And in fact the frequency ranges overlap so your definition becomes a bit more tricky than you make out)

I can see EM radiation with wavelength 570nm (yellow), so I would define it as a colour! I just happen to see it by stimulating more than one cone type at once.

so if you define colors as wavelengths of electromagnetic radiation then the cardinality of the set of all colours in the rainbow is aleph-sub-one

As tilly pointed out, you don't get mixtures of blue and red light in a rainbow, which we see as pink-purples (the line of purples on the CIE chromacity diagram.)

Update: In fact, you don't get any mixing in a rainbow (approximately, obv mist is not a perfect refractor and probably some other caveats like angle and distance), so it's like going around the edge of the chromacity diagram... so there's quite a few less than all possible colours/hues in a rainbow.. but still probably infinite (I'm not a mathematician either, so no fancy 'alehps' from me... :P). That's my current conjecture anyway!

........
Those are my principles. If you don't like them I have others.
-- Groucho Marx
.......

As tilly pointed out, you don't get mixtures of blue and red light in a rainbow, which we see as pink-purples (the line of purples on the CIE chromacity diagram.)

It's way more complicated than that. What we see at any given point, at any given moment in time, in our mental image of a rainbow, is not the result of a single pure frequency stream of EM emanating from that point.

If that were the case, then everything we see would scintillate between shades of red, blue and green as we move our heads. Because if the stream of photons coming from that point source are accurately focused, they would only hit one cone at a time: say red. Then when you moved your head slightly, that point source would hit a different cone, say green. And so on.

You have to appreciate that the image we see is a complex, time-averaged (think:persistance of vision), sum of the frequency responses of photons hitting many cones of the three types, as that point source and/or our heads and bodies move. In the same way that ultrasound images are not instantaneous snapshots of the reflected waves from a single position of the tranducer, but rather a complex mapping of the responses from many points as the transducer is moved around in both 3D space, and over time.

So whilst there my not be any mixtures of 'red' and 'blue' frequencies in the spectrum at the source of the light, by the time it has been refracted through a billion drops of water, with some frequencies being attuenuated by the gasses in the air on the way to and from the raindrops; and by the water, and whatever contaminants it contains, of the raindrop itself. Add to that, any coincident (reflected, refracted and backgound light from other sources), photons that reach our eyes from the same direction, and what we "see" is an entirely different thing to what is there (in the rainbow), to begin with.

Even teh rainbow itself is an entirely nebulous entity. Consisting of only some small patr of the frequencies in the original light source that happen to refract in out direction. If air currents (wind, inversion layers etc.), cause the falling raindrops to change tragectory half way through their transition across the piece of sky where the angle is correct for the light to be refracted in our direction, then the frequency of the portion of the source that comes our way will change. Simple put, the rainbow will appear to ripple.

The term "colo(u)r" only makes sense in terms of our perception of what we see. And that perception is far from set in the frequencies of EM coming from any given point source. It is also influenced (a lot) by everything else we are seeing at the time. That is no more clearly demonstrated than by this famous optical illusion

Our perceptions have almost nothing to do with the frequencies of the EM spectrum. Hence my brother's yellowish coloured car looked almost purple under low-pressure sodium street lighting.

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.

"Science is about questioning the status quo. Questioning authority".

In the absence of evidence, opinion is indistinguishable from prejudice.

If that were the case, then everything we see would scintillate between shades of red, blue and green as we move our heads. Because if the stream of photons coming from that point source are accurately focused, they would only hit one cone at a time: say red. Then when you moved your head slightly, that point source would hit a different cone, say green. And so on.

This assumes that only one cone will respond to a specific frequency. This is not true. As this diagram shows, the responses of the cones overlap, so you get a continuously varying mixture of colours as the wavelength varies.

When putting a smiley right before a closing parenthesis, do you:

Use two parentheses: (Like this: :) )
Use one parenthesis: (Like this: :)
Reverse direction of the smiley: (Like this: (: )
Use angle/square brackets instead of parentheses
Use C-style commenting to set the smiley off from the closing parenthesis
Make the smiley a dunce: (:>
I disapprove of emoticons
Other