There are actually only three colors that we can see.
Our eyes contain color sensing cells called cones. There are three types, and they each can sense one color. The colors are red, green, and blue.
But the cones in your eyes respond rather broadly to the light that comes in, so that some red light will also stimulate the green cones, and to a lesser extent the blue cones. Some blue light will stimulate the green cones, and the red cones a little bit less. And some green light will stimulate the blue and red cones.
As a result, colors of light that lie in between the colors that the cones receive best will stimulate two or more cones at the same time. We see light that stimulates red and green cones at the same time as yellow. Violet light stimulates the blue and the red cones.