Rainbows are one of the most beautiful things in nature. They are also great examples of how light and water can combine to create something magical. Have you ever noticed the shape of rainbows? They always have a curved shape with seven different colors.

But why does this happen?  So next time you see a rainbow, remember it’s not just a collection of pretty colors. It’s also a fascinating example of science in action! So, what’s the science behind the colors and shapes of the rainbow? We will be waiting to hear from you.

What is a Rainbow ?

A Rainbow is an optical and meteorological phenomenon that causes a spectrum of light to appear in the sky when the sun shines on droplets of moisture in the Earth’s atmosphere. Rainbows caused by sunlight always appear in the section of the sky directly opposite the sun. Rainbow has different colors because of the dispersion of sunlight by water droplets. When light passes through a drop of water, it is refracted (or bent) and split into its component colors: red, orange, yellow, green, blue, indigo, and violet. The reason why there are seven colors in a rainbow instead of six or eight has to do with the physics of how light waves interact with each other.

How is a Rainbow formed?

Rainbow is usually formed when the sun is at an angle of about 42 degrees above the horizon. At this angle, the sun’s light is refracted (or split) by raindrops in the air and forms a spectrum of colors. The Rainbow appears as a circle of colors with red on the outside and violet on the inside.

The amount of bending depends on the angle at which the sunlight hits the water droplets: the steeper the angle, the more the light is bent. This is why the Rainbow appears curved: the light is bent more at the top than it is at the bottom.

Why are there seven colors in a Rainbow?

You might be wondering why there are always seven colors in a rainbow. Well, this is because sunlight contains all of the colors of the rainbow. But when the sunlight hits the water droplet, it splits up into these seven colors.

The order of the Rainbow colors

The colors of a Rainbow always appear in the same order: red, orange, yellow, green, blue, indigo, and violet. This is because each color is a different wavelength of light, and when light waves combine, they do so in a way that preserves the individual wavelengths. Each color has a different wavelength. Red has the longest wavelength and violet has the shortest wavelength.

What is the shape of Rainbow?

Rainbows always have a curved shape. This is because the water droplets that create rainbows are never the same size. Some of the water droplets are large and some of them are small.

So, when the sunlight hits the different-sized water droplets, it bends (or refracts) at different angles. This is what creates the curved shape of the rainbow.

Is the shape of the rainbow semi-circular or circular?

The rainbows are circular (full circle) in shape. However, mostly we see it as a semicircle or an arch. The Rainbow appears semi-circular when we look at it from the ground because of the way sunlight is refracted by water droplets in the atmosphere. As the observer/viewer is standing on the ground the other half of the circle is cut off due to the surface of the earth acting as an obstacle.

Full-circle rainbows can be seen from a high mountain or from airplanes. Pilots have a better view of full-circle rainbows provided if weather conditions support them.

Why do we see a Double Rainbow in the sky?

A double rainbow is formed when sunlight is reflected off the surface of the droplet not once but twice. So, we see two bands of rainbows in the sky. The inner Rainbow is always brighter than the outer Rainbow.

Rainbow Facts

– Rainbows always appear in the same order: red, orange, yellow, green, blue, indigo, and violet.

– A Rainbow is a full circle. We just see a semi-circle because we are looking at it from the ground.

– Double rainbows occur when sunlight is reflected off the surface of the droplet not once but twice.

– The Rainbow is a meteorological phenomenon and not an optical illusion.

– The Rainbow appears when the sun is behind you and the raindrops are in front of you.

– You can only see a Rainbow if there are water droplets in the air.

So, let us enjoy the beauty of rainbows and at the same time learn something.

With all this information, we hope you have a better understanding of rainbows.

Let’s incorporate STEM/STEAM with this beautiful phenomenon

Math in Rainbow

Rainbows provide a good opportunity to study shapes and patterns in the sky. By looking at the Rainbow, we can see different shapes like a semi-circle, a circle, and a triangle. We can also see patterns in the Rainbow like the colors always appear in the same order: red, orange, yellow, green, blue, indigo, and violet. Rainbows are also used to study some math concepts such as fractions, ratios, and proportions.

Science in Rainbow

The science behind rainbows can be explored with some hands-on activities. Students can use a prism or a glass of water to create their own Rainbow. By shining a light through the prism or glass of water, the different colors that make up the Rainbow can be seen. This is a good opportunity to discuss how sunlight is refracted by water droplets and how this creates the Rainbow.


Design and Technology

Rainbows can be designed and created at home using different materials. Students can explore different ways of generating a rainbow. For example, they can use Compact discs, mobile phones, or torchlight. By shining light through the different materials, they can observe how each one creates a Rainbow with its own unique pattern.

Art with Rainbows

Rainbows can be used as inspiration for art projects. Students can use different colors to create their own Rainbow. They can also experiment with different mediums like painting, drawing, or even sculpting.


Rainbows can also be generated with code. By using the colors of the Rainbow, students can create patterns and designs with code. This is a good opportunity to explore algorithms and how they can be used to create different shapes and patterns.

Our students are also exploring different colors of light in online Robotics courses using RGB LEDs to create their own rainbows. The colors Red, Green, and Blue are mixed in different proportions by coding the Arduino microcontroller to generate different colors of the rainbow. Also, the students mix the different colors of light to create white color. Project-based learning with SkoolOfCode provides an opportunity for students to apply the concepts they have learned in a fun and engaging way. So, if you are seeking introductory or advanced online coding classes for kids Book a FREE trial class today.

This blog is in line with SkoolofCode’s philosophy of STEM-based holistic learning. Our mission is to make all learning STEM-based so that our students are not just limited to theoretical knowledge but they can also relate it to the real world.


Rainbows are one of nature’s most beautiful phenomena. They are also a great way to learn about STEM concepts. So, the next time you see a Rainbow, take a moment to appreciate its beauty and think about all the different colors that make it up. Rainbow STEM is a fun and educational way to explore the science behind this amazing phenomenon.


By – Dr. Kadam Bhambari , an Educator at SkoolofCode with Ph.D. and MTech in Electronics. She is an expert in Microbit, Arduino, and Artificial intelligence.