A 1-in-100-million “cotton-candy” lobster that exhibited vibrant pink, purple and blue hues was caught by a lobsterman off the coast of New Hampshire in late July.

Joseph Krame, the 25-year-old who caught the specimen, donated his rare catch to the Seacoast Science Centre in Rye, New Hampshire where the lobster, which is said to be “healthy and eating well,” can now be seen on public display, Karen Provazza, a staff member of the Seacoast Science Center, told Live Science in an email.

Lobsters are typically a mottled brown color, which helps camouflage them on the ocean floor. However, lobsters are also found in a variety of colors at lower frequencies including orange, blue, and even two-toned. The reason for this variation is due to genetic mutations that change the chemistry of a pigment they ingest.

All lobsters take in a red pigment, called astaxanthin, that comes from the plants and smaller crustaceans they eat. It’s this pigment that gives lobsters their striking red coloration after cooking, and also their natural mottled brown appearance.

The lobster exterior is made up of layers; first the skin, followed by two layers of shell. After ingestion, the red pigment is stored in the skin layer. The pigment then moves into the lower shell, which appears blue, due to interactions with proteins present in the shell that twists the pigment. Finally, when the pigment moves into the upper shell the pigment interacts with different proteins to create a yellow hue.

Related: ‘You can see its guts and things’: Weird see-through crustacean with giant eyes discovered off the Bahamas

So when we look at a lobster, we are in fact looking through each of these layers – a yellow, blue and red layer — and this gives the lobster a mottled brown appearance. Cooking the lobster breaks down these proteins, returning astaxanthin to its distinctive red color.

The variation in lobster coloration comes from genetic mutations that change the way this pigment interacts with proteins in the shell. Blue lobsters carry a mutation that produces more of the proteins in the lower shell layer, which pulls more of the red pigment from the skin into the shell layer. This mutation is present in around one in 2 million lobsters.

“Cotton candy” lobsters are even rarer — occurring at a frequency of about 1-in-100-million. The precise genetic causes of this coloration is unknown, but it’s thought that something disrupts the normal pigmentation process, allowing more of the red astaxanthin to be seen through the blue layer. The result is “a mixture of pinks and purples on a blue backdrop resembling cotton candy,” Provazza said.

In addition to the lobster’s DNA, diet may also alter its color. The intensity of color hues in lobsters with mutations that predispose certain color variants will depend on their diet. For example, if the lobster is mostly fed on bait fish they would ingest less astaxanthin, compared to a typical lobster diet of astaxanthin-rich crab and shrimp.

So why are these lobster color variants so rare? Firstly, mutations underlying these variations will occur at a very low rate. In addition, brightly-colored lobsters are less able to hide on the ocean floor, making them likelier to be preyed upon, thus lowering the odds of them surviving long enough to pass on their genes.

The cotton candy lobster, estimated to be between 8 and 10 years old, will spend the rest of its days at the Seacoast Centre in New Hampshire, safe from predators and New England summer lobster bakes. It joins another cotton candy lobster caught in November 2021.

Editor’s Note: Planet Earth and Animals editor Hannah Osborne contributed reporting to this article.