As we now know, the Young-Helmholtz theory of three types of receptors for three primary colors and Hering's theory of three pairs of opponent colors are not mutually exclusive. The former is correct at the receptor (retina) level, whereas the latter is correct for subsequent stages in the visual pathway (LGN and V1). In both schemes colors are represented by three variables, RGB at the receptor level, R-G, B-Y, and B-W at the LGN/V1 levels. These two representations are really equivalent as they both can be considered as the basis functions of the 3D color space.
Consider two sets of color-sensitive cells (receptors in retina or neurons in
LGN or cortex). The first set responds to three primary colors R, G and B by
An interesting question to ask is why nature would chose to use R-G, B-Y and B-W color opponency system in the brain, instead of the same seemingly simpler RGB (i.e., LMS) system used in the retina. A possible answer is that color vision was evolved from monochromatic visual system in which only a one-dimensional signal Black-White between the two extremes is needed. When two different types of receptors S and ML were evolved in the dichromatic system (most mammals except primates), the brain needed to adapt to process colors in a 2D space, presumably, by adding a new dimension of Blue-Yellow (same as S-ML) to the original B-W,which is the most convenient thing to do. Later when the ML type receptors were separated to become two different types M and L (primates, etc.), again it was most convenient for the brain to add the third Red-Green dimension to accommodate the new L and M receptors. Therefore the three types of olor-opponent cells in the cortex were evolved as the result of the progressive adaptation of the brain to increased number of receptor types in the retina.