The iconic iceberg is a towering white hunk of snow-covered ice, common in cold oceans. But take a trip to Antarctica and you will discover that icebergs come in myriad hues and multicolor patterns, even resembling striped candy. Icebergs can be green, blue, yellow or black. The ice can shine like a sapphire or be as murky as a frozen mud puddle.

An iceberg’s color is determined by how it interacts with light. Basic physics would predict that icebergs should be blue. That’s because “pure ice”—frozen water that is free of contaminants—absorbs longer wavelengths of visible light (yellows and reds) more effectively than shorter ones (indigos and blues). A thick slab of pure ice would filter out red light, says Stephen Warren, a researcher at the University of Washington who studies the interaction of sunlight with icebergs. Blue light would reflect back toward our eyes, making the ice appear blue.

Why, then, is the iconic iceberg white? Because it is usually covered in densely packed snow. Snowflakes reflect all wavelengths of light equally, so a snow-covered chunk of ice appears bleached. Strip away the snowy blanket and an iceberg reveals its true color. “If you walk out onto a snow-covered glacier and look down into a crevasse, it will look blue,” Warren says.

Icebergs are enormous shards of ice that splinter off when the front edge of a glacier meets the sea. Glacial ice is snow that has compacted into ice crystals and fused into giant ice slabs, becoming blue.

Icebergs of other colors form a different way—from freezing seawater. Frozen seawater can accumulate as “marine ice” under ice shelves that extend from a glacier out over the ocean, says Daniela Jansen, a geophysicist at the Alfred Wegener Institute for Polar and Marine Research in Germany, who studies Antarctic ice shelves. When this happens, particles suspended in the water get incorporated into the ice. The particles can change ice’s interaction with light and thus its color. Dead, crushed cells from sea life, or iron-rich rock dust, both turn marine ice shades of green and yellow. Large amounts of dead organic matter reflect yellow light, Warren says, but just a small amount will make an iceberg shimmer like jade.

Translucent, sparkling blue bergs form from particle-free seawater. Marine ice contains much less air than glacial ice, giving it gemstone clarity; bubble-filled glacial ice typically appears cloudy. Shiny black icebergs are made of defect-free marine ice. “There is nothing to scatter the light,” Warren says. Add in light-scattering cracks and the ice will regain its blue hue.

Cracks also factor in creating striped icebergs. Fissures in the base of an ice shelf can become flooded with seawater that then freezes. If a series of cracks open simultaneously, the iceberg is streaked with bands of a single color. If cracks open over time, and get flooded by different kinds of seawater, the iceberg’s stripes can be multicolored. Blue stripes can also form on the top of glaciers when its own melt water freezes in crevices.

Yellow, green and multicolored icebergs require the existence of glacial ice shelves and very cold conditions—cold enough to freeze seawater—so they arise only in Antarctica. Bergs in the Arctic are white, or blue if their snow jackets have melted. A warming ocean could reduce the number of tinted bergs, already uncommon. But scenarios exist where marine ice could continue to form at higher ocean temperatures, says Laura Herraiz Borreguero a researcher at Southampton University, UK, who studies the melting of Antarctic ice shelves. If the ice shelf remains intact, water could still potentially freeze to its underside because the huge, downward pressure of the shelf can alter the freezing temperature of water immediately under it. If that surface was later exposed to a warmer ocean as it rolled over so it could be seen, it might melt quickly.

Ultimately, would colored icebergs disappear as the planet warms? That’s a good question with no clear answer, Borreguero says.