Color Theory is both a very simple and somewhat complex study. The basics are pretty simple if you have a background in introductory physics, but the little details can get a little hairy.
Visible light is light that has wavelengths from about 380 nm to about 700 nm. Each wavelength of visible light has an associated color. A mixture of all wavelengths of visible light appears white. Several colors we perceive are only possible as combinations of two or more wavelengths. A rainbow is a common representation of all of the colors the human eye can see as broken down by wavelength. Often times, these colors are recalled by the mneumonic ROY G BIV, or more completely, Red Orange Yellow Green Blue Indigo Violet. Unfortunately, the details are pretty ambiguous from there.
What wavelength is, for instance, "Indigo?"
I am proposing that we expand the pallete of monochrome (single wavelength) colors to be as follows:
Red: 645 nm
Orange: 600 nm
Yellow: 580 nm
Lime: 570 nm
Green: 540 nm
Cyan (or Aqua): 490 nm
Blue: 460 nm
Indigo: 420 nm
Violet: 400 nm
Some people speak of "primary colors," which may have an ambiguous meaning.
The human eye has the ability to detect light of four different natures. Rod cells in the eye are less sensitive to wavelength than cone cells, so the cone cells (of which there are three types) are responsible for the way color is seen. Recently, it has been observed by some (I'll try to find the source later) that different people's varying genetics may be responsible for some phenomena that affect the way these cone cells respond to different wavelengths of light. But, on average, color vision is classically broken down into detection of reds, greens, and blues or violets. I think that the peak responses of the three kinds of color vision cone cells are 572 nm red, 540 nm green, and 430 nm blue. The red responds better, actually, to yellow than to red, according to these numbers, but because the green cells no longer respond to light beyond 630 nm, light above 630 nm appears more distinctly red, and beyond that wavelength, the other cone cells do not respond at all, meaning that it is pretty much impossible for the average person to determine a difference between 645 nm light and 675 nm light (both appear red, although they will appear with different brightnesses at the same absolute luminousity),
Okay, so one way to set up "primary colors" in terms of wavelength would be based on the response of the human eye. This would put the high wavength primary around 640 or 650 nm, so that it will not interfere with the medium range, the low wavelength primary around 430 or 440 nm, for the same reason on the other end, and the middle primary at peak response of the middle channel at 540 nm. But then, why can we tell the difference between blue, indigo, and violet? Well, here is where things get a little complicated. As it turns out, there is a secondary peak of response of the high wavelength cone cell at low wavelengths, meaning that it, on its own, responds to violet light. Choosing blue as a primary means that violet can be created by mixing the two outside channels together, and this works fairly well in practice.
Composite colors may be able to trick the human eye into seeing a color of a certain wavelength by triggering the same responses in the color cones as that particular wavelength would. Color televisions, monitors, printers, etc. all take advantage of this effect. The pixels of the screen with which you are reading this text are most likely only able to produce monochromatic light at three wavelengths corresponding to red, green, and blue. So to make yellow, equal parts of red and green are used. Yellow light triggers a response of the green cones and of the red cones, so stimulating each cone with light at its maximum response will have the same effect of light with a wavelength in between, but this leads to some other complication - if you mix equal parts of blue and red (pink or magenta), you achieve production of a composite color that cannot possibly be represented by a single wavelength. There are several other colors that can be produced by composing two or more wavelengths - browns, pastels, hues, etc.
So, is there an equation for translating from wavelength to composite or vice-versa? Well, sort of. There are algorithms developed mostly at universities as computer programs from the 1980's and 1990's that will convert a wavelength into a device RGB setting, but going backwards can only lead to a single wavelength solution in rare cases, and if multiple wavelengths are allowed, there will be an infinite number of solutions. The cheapest way to solve is to allow three wavelengths as the solution and just have those three wavelengths as the wavelengths of the components of the pixels, assuming that they are monochromatic.
Further complicating the field is the fact that screen displays, pigments, scanners and digital cameras have only approximate correlation to the color detection of the human eye. For example, most digital cameras have a CCD (charge-coupled device) that records the image pixel by pixel. To achieve color photographs, there is a matrix of filter materials over the elements of this CCD intended to only allow red, green, or blue light through. To save on costs, these filters are typically unable to filter ultraviolet and infrared light, so you can use your digital camera to detect these invisible wavelengths from devices such as television remote controls and anti-counterfeit UV lights.