Typically, the exoskeleton of most crustaceans has a blue-green to grayish color and sometimes they appear a brown or olive green, with just a hint of red; with a few exceptions like the blue and yellow lobsters and crabs. The exoskeletons of such creatures are made up of several pigments, one of which is a carotenoid called astaxanthin, which provides its reddish coloring (astaxanthin is the same carotene that gives salmon its color).
At normal temperatures and when alive (in other words, when we’re not dumping them in boiling water or grilling the poor guys), the astaxanthin pigments are hidden because they are covered with other protein chains that give their shells the bluish-gray or brownish-green color we see.
Exposure to heat destroys this protein coating,while the carotenoid pigment, astaxanthin still remains stable. So when you cook a crab or lobster or its other tasty crustacean friends for that scrumptious meal you forgot to invite me for 🙂 , the heat breaks down all the pigments except for astaxanthin; thus, causing the bright red color we see in cooked lobsters, crabs, and crayfish or the reddish-orange color of cooked shrimp.
Now you might be wondering, “What about the very rare, 1 in 2 million blue lobster? Does it turn red when cooked?” YES! Even the exceptionally rare 1 in 30 million yellow lobster turns red. (however, seems kinda silly to cook such a rare little guy). Only the albino crab and lobster do not turn red when cooked. For the obvious reason that they have no pigmentation and therefore, remain the same color even when cooked, white.