Here's a purely mathematical rainbow spectrum plot. Reasoning: - All colours in the rainbow spectrum should be shown with equal intensity. - In RGB, yellow(1,1,0) has greater intensity than red(1,0,0) or green(0,1,0). - So, we need a less intense yellow for our rainbow. - I used intensity = (cos(a)+1)/2 where a is an angular offset in the spectrum. - The rainbow is an octave of light, from 400THz-800Thz, or 750nm-375nm. - We can see 12 rainbow colours, like the 12 musical notes. - The colours red, green and blue correspond to tonic, major third, dominant. - The notes have relative frequencies of approx pow(2, i/12), for i in 0..11 - The 12 notes are almost equally spaced, and correspond to 12 resonances. - The 12 resonances are simple fractions involving the primes 2, 3 and 5. In order of complexity: 2 3 5 name freq order colour 0 0 0 tonic 1 0 red -2 1 0 dominant 3/4 -5 blue 2 -1 0 sub-dominant 4/3 5 -2 0 1 mediant 5/4 4 green 2 0 -1 mnr.submediant 4/5 -4 -4 1 1 leading 15/16 -1 4 -1 -1 upper leading 16/15 1 1 1 -1 mnr.mediant 6/5 3 yellow -1 -1 1 submediant 5/6 -3 -3 2 0 supertonic 9/8 2 2 -3 0 subtonic 8/9 -2 -5 2 1 dominant lead 45/32 6 5 -2 -1 subdom. upper lead 32/45 -6 In pitch order: 2 3 5 name freq order colour 5 -2 -1 subdom. upper lead 32/45 -6 light blue -2 1 0 dominant 3/4 -5 blue 2 0 -1 mnr.submediant 4/5 -4 indigo -1 -1 1 submediant 5/6 -3 violet 2 -3 0 subtonic 8/9 -2 magenta -4 1 1 leading 15/16 -1 hot pink 0 0 0 tonic 1 0 red 4 -1 -1 upper leading 16/15 1 orange -3 2 0 supertonic 9/8 2 yellow 1 1 -1 mnr.mediant 6/5 3 grass -2 0 1 mediant 5/4 4 aqua 2 -1 0 sub-dominant 4/3 5 cyan -5 2 1 dominant lead 45/32 6 light blue Note that the "sumdom. upper lead" and "dominant lead" notes are most distant from the tonic, and very similar; they differ by less than 1/5 of a semitone, They lead strongly to modulations: the dominant major and sub-tonic minor. They are commonly regarded as a single note. If using a single frequency, its value should be the intermediate, sqrt(2), from which the harmonies differ by under 1/10 of a semitone. This is the only harmonic "compromise" in the chromatic 12-tone scale. - The refractive index varies with the wavelength of light. - The rainbow is a uniform plot over wavelength (not freq. or "note"). - Several "rainbow echoes" are seen, due to resonance with higher octaves. - Each "rainbow echo" is half the width of the previous, as expected. - And so, the colours in the visible rainbow are compressed at the blue end. Here is a picture of rainbow echoes, these are due I suppose to harmonic resonance: ![rainbow with echoes][1] Combining these ideas, here is a calculated rainbow. ![enter image description here][2] [1]: http://i.stack.imgur.com/P4Cwa.jpg [2]: http://i.stack.imgur.com/7Mbk6.png