“And why, bhikkhus, do you call it perception? ‘It perceives,’ bhikkhus, therefore it is called perception. And what does it perceive? It perceives blue, it perceives yellow, it perceives red, it perceives white. ‘It perceives,’ bhikkhus, therefore it is called perception.
In pigment color theory, blue, yellow and red are the primary colors. By taking a white surface and mixing blue, yellow, or red you can make most colors.
How did the Buddha choose those specific colors to define perception?
Those three colours are the primaries used in mixing physical pigment, so were well known in the Buddha’s time by artisans. The underlying reliance on skill and craftsmanship in the suttas is largely shunned as primitive in the western view:
“Thus we can say that the Dhamma — in terms of doctrine, practice, and attainment — derives from the fully explored implications of one observation: that it is possible to master a skill. This point is reflected not only in the content of the Buddha’s teachings, but also in the way they are expressed. The Buddha used many metaphors, explicit and implicit, citing the skills of craftsmen, artists, and athletes to illustrate his points.”—Thanissaro
The skillfulness often referred to in the suttas refers to the path before awakening, where conditioned phenomena must be handled in a way which turns their use from perpetuating ignorance to generating awakening. One factor helpful is the ability to recognize a theme in thought or meditation:
" The musician then picked up the theme (nimitta) of the composition. The theme functioned in several ways, and thus the word “theme” carried several meanings. On the one hand it was the essential message of the piece, the image or impression that the performer wanted to leave in the listener’s mind. On the other hand, it was the governing principle that determined what ornamentation or variations would be suitable to the piece."—Thanissaro
The Visuddhimagga uses “colour element” to mean paint in describing the blue, yellow and red kasinas. This is the order they appear on the colour wheel, (though today listed in the clockwise direction), so they knew about colour theory.
It’s a work in progress to relate the primary colours to the physical elements. In Chinese culture there are five elements (in colour three primaries plus black & white), and these five Cambodian Buddhas and their haloes and animals are related to those. The last two are earth (yellow- present Buddha) and wood (violet and green, secondary colours) :