Chasing Coral, the stunning documentary capturing the devastating effects of climate change on Australia’s Great Barrier Reef, makes one thing abundantly clear in its imagery: Coral are among the most colorful things on this planet, but their vibrant hues are at risk of heating oceans bleaching them to death.

A combination of factors — water temperature, depth, sunlight, and genetics — join forces to make the reef the symbiotic community of vulnerable algae and coral it is.

Algae contains high amounts of chlorophyll, which allows it to absorb energy and derive nutrition from sunlight. Chlorophyll is what gives plants their green color, which is why coral reefs have a generally earthy color to them. But the greens are overshadowed by bright reds, oranges, and blues that originate elsewhere.

The algae, called zooxanthellae, uses its coloration to protect itself from the sun, using the bright colors to absorb and filter out potentially-harmful ultraviolet light, a sort of coral version of sunscreen. That coloration is generated by 21 molecules called chromoproteins, which absorb and filter out potentially-harmful ultraviolet light through bluish, purple, and sometimes orange hues.

And that’s why coloration gets even more intense when ocean temperatures rise before ultimately bleaching the coral to death.

coral reef aquarium scrips birch aquarium fish fishes color
Coral found in the Scrips Birch Aquarium in California

Light is also filtered more and more the deeper you go underwater, so coral’s color changes based on how far down it grows. Blue light penetrates water deeper than red light does, so coral in shallow waters is rife with warm colors that grow cooler and duller the lower down it goes.

Corals coral reef deep water blue
Coral found in deeper water is exposed to different wavelengths of light, giving it a cooler set of colors.

But even when two zooxanthellae from the same species are sitting right next to each other, they can have different colors from each other. Research published in the journal Molecular Ecology in 2015 discovered that there are a number of genes responsible for reef coloration, so even zooxanthellae of the same species in identical environments can display different colors depending on how many of those genes they have.

Coral color photo
Genetic variance explains color differences within the same species of coral
Photos via Flickr / gvgoebel, Flickr / Stanislav Pecha, Flickr / TravelingShapy, Jan Mallander/ Pixabay