The tristimulus theory of color perception says that all visible spectral distributions can be accurately represented for human observers using three scalar values (three primary colors).

Integrating the product of a spectral distribution with three tristimulus matching functions gives three tristimulus values :

Those three matching functions define a color space.

Note

the tristimulus values for the product of two spectral distributions are not given by the product of their tristimulus values. This is why using tristimulus color like RGB for rendering may not give accurate results.

References