Rainbows can be seen when it is both raining and sunny. You can only see a rainbow when your back is to the sun, because a rainbow is basically a reflection. The sun shines a white light, which our brains see as many different colors. So, when the the sun shines on the sky (blue), although the light is white, we automatically know it as blue. All the colors of the rainbow mixed together are black, so when you look at something black, it is black because it is absorbing all the colors of the rainbow.
I hope you enjoyed these interesting color facts!