The "pattern of nature" of blue, red and yellow is actually a basis of subtractive primary colors. Subtractive primary colors form other colors through the absorption light. For example, if you mix yellow and blue paint, we have a darker green color, right? This is because the new pigment absorbs both the yellow and blue frequencies - the frequencies that remain and are reflected "cause" the feel of the green color. So the more paint you mix, the darker the pigment will become, because it will absorb more colors.
Computer screens, however, do not reflect light - on the contrary, they emit light. In this case, "mixing the pigments" actually implies emitting light at various frequencies. This means that the more colors are emitted, the lighter the color (because there will be more light). Of course the combination could not be the same as the subtractive colors - in fact, it is quite the opposite: to get the combinations of additive colors, just do the "reverse operation" to the subtative colors. As well says Wikipedia:
The most commonly used additive primary colors are the secondary colors of the most common primary subtractive colors, and vice versa.
Overlay diagram of additive primary colors yellow, red and blue (Source: Wikimedia Commons)
As RGB primarily serves to represent color on monitors, it uses additive primary colors.
Now, it is worth noting something important: although they teach her in school, a subtractive color base with red, blue and yellow is bad, because it is not orthogonal. You yourself noticed this by saying that an area painted with yellow and blue "becomes green (or at least something similar)." This base is known as RYB and is taught more for historical and perhaps didactic reasons than for being an efficient basis.
A base subtractive primary colors much better, and that is the most used in practice, are yellow, magenta and cyan (besides black, not to waste ink).
Diagram of subtractive yellow, cyan and magenta primary color overlays (Source: Wikimedia Commons)
This base is known as CMYK (from "Cyan, Magenta, Yellow and Key (black)") and is extremely important in design and printing. If you look at the cartridge of an ink printer, you’ll probably see these four colors. (Black goes along because, although it can be composed in theory with the other colors, it is a much used and pays to be sent apart, in addition to facilitating the darkening of the other shades. There may also be cartridges of other colors, depending on the uses of the printer.)
Note the four colors in the bottom right corner of the image. (Source: Wikimedia Commons)
This post is a fascinating exploration of this theme (and my main source :P )
http://riftlabs.com/2010/09/how-rgb-light-works/
– Kazzkiq
Light emitted vs Light reflected, I believe...
– brasofilo
The answer given by @brandizzi already clarifies the question. One case is color subtraction, the other addition.
– Piovezan
For those who care, here an interesting post (in English) explaining how colors "work" differently: a) as ink; b) as light; c) as electromagnetic waves; d) in our brain.
– mgibsonbr
These are not the colors of nature, but the colors of the painters "of the old" and "aunt of the primary". It is not very scientific to choose these colors, the one of CMYK is more precise. Worth a researched in the functioning of the retina of humans, in particular of cones and rods. (recalling that in other living beings the spectrum is different, and that there are some cases where people have different perception of these colors and even more spectrum variation).
– Bacco
The question is interesting, but is it on-topic on a programming site? It’s okay that part of the fact that RGB is used in monitors and therefore common when programming, but the answers seem to be about physics, neuroscience and even retinal morphology!
– bfavaretto
@bfavaretto Ah, but just now I was going to ask "Is the blue I see equal to the blue that other people see?" /rofl
– Bacco
@Bacco the truth is that the blue you see, I can see it in another completely different way, the point is that that "pattern" you see associates the word blue :)
– Jorge B.
This question is not out of context with regard to programming, it is only limited to the Color Theory which is, for example, one of the points used in character recognition algorithms or even images (see Google Image Search).
– Bruno Augusto