It is all about color theory.
What is color theory?
Color Theory is a set of principles used to create harmonious color combinations. Color relationships can be visually represented with a color wheel .
According to color theory, harmonious color combinations use any two colors opposite each other on the color wheel, any three colors equally spaced around the color wheel forming a triangle, or any four colors forming a rectangle .
The first color wheel was invented by Sir Isaac Newton. He split white sunlight into red, orange, yellow, green, cyan, and blue beams.
A century after Newton, Johann Wolfgang Goethe began studying psychological effect of colors. He noticed that blue gives a feeling of coolness and yellow has a warming effect. Goethe created a color wheel showing the psychological effect of each color.
A color circle, based on red, yellow and blue, is traditional in the field of art.
Colors in the red area of the color spectrum are known as warm colors and include red, orange, and yellow. These warm colors evoke emotions ranging from feelings of warmth and comfort to feelings of anger and hostility.
Colors on the blue side of the spectrum are known as cool colors and include blue, purple, and green. These colors are often described as calm, but can also call to mind feelings of sadness or indifference.
It's important to recognize that individual colors have a bias towards cool or warm for color mixing. If you mix two warms together, you'll get a warm secondary color and, conversely, if you mix two cools together you'll get a cool secondary.