Hiding out in the park’s hot springs — where temperatures are high enough to blister your skin and as acidic as liquid in a car battery — are heat-loving microbes. And they’re thriving. Where you see rings of color, there are, most of the time, rings of different bacteria, each group adapted to the conditions, such as temperature and pH (how acidic a solution is) of their environments, according to the National Park Service.

Take Grand Prismatic Spring, the park’s largest hot spring and the one whose rainbow colors make it so iconic. Its diverse hues can be explained by the ways temperature and light affect microbes.

Aquamarine to dark blue

Let’s start at the center of the hot spring, a brilliant aquamarine. The center of the spring is just above its underground water source, and it’s where temperatures are the highest — up to 189 degrees Fahrenheit (or 87 degrees Celsius), Smithsonian reported. There, the water is too hot for most microbial growth. It is, therefore, mostly clear water. The center of the spring is blue for the same reason that the sky is blue: When sunlight hits the water’s surface, the light scatters, and blue light scatters the most, meaning that’s what reflects back to your eyes.

The hot spring’s water cools as it spreads farther from the source, and that, in turn, changes the bacteria that can live in it.

Yellow

Moving outward from the blue center, the first ring of color is yellow, thanks to cyanobacteria called Synechococcus. The temperature of this yellow band is about 165 degrees F (74 degrees C). Under other conditions, these bacteria might create a blue-green hue thanks to chlorophyll, a green pigment they produce that allows them to photosynthesize, or build carbohydrates and oxygen gas out of water, carbon dioxide, and energy from the sun, during the day, according to the National Park Service. (At night, they switch to another mode of energy production, fermentation.) But the sunlight hitting the prismatic spring is so intense that the bacteria produce another kind of pigment called carotenoids, which act as sunscreen for the bacteria, according to the Smithsonian magazine. Carotenoids, which are also found in carrots, are orange and thus turn the normally green Synechococcus bacteria a more jaundiced shade.

Orange

In the orange band, which is a cooler 149 degrees F (65 degrees C), you’d find not only Synechococcus bacteria but also Chloroflexus bacteria, which also contain both chlorophyll, for photosynthesis, and the carrot-colored carotenoids. Two other bacteria that produce orange-colored mats, Phormidium and Oscillatoria, which are both found in Mammoth hot springs within Yellowstone.

Red-brown to burgundy

As you get farther from the center of the hot spring, the temperatures get lower and there is a greater diversity of microbes that can survive there, Smithsonian’s Natasha Geiling reported. The spring’s outermost layer, at 131 degrees Fahrenheit (55 degrees Celsius), is a red-brown or burgundy color.

According to livescience.com