Lobster, crab, and shrimp are all crustaceans, which means they have an exoskeleton (or external skeleton) that appears as a hard shell or crust. In the sea, the shells of crustaceans display a variety of colors, but when crustaceans are uncooked, the green-blue hue of the protein complex of the outer shell predominates.
In lobsters, crab, and shrimp, however, a pigment called "astaxanthin" lies hidden, camouflaged by a protein covering. Astaxanthin is a member of the carotene family of pigments, which are responsible for coloring many of the yellow and orange (or "carotene") fruits and vegetables.
Because these protein chains are not heat-stable, their protein wrapping uncoils as soon as crustaceans are put in boiling water. Voila! Red-orange astaxanthin molecules are released. Because pigments related to the carotenes are stable, the astaxanthins now display their unique deep hues that are so appealing.
Those who enjoy the delicacy of these gifts from the sea know their flavors are as appealing as their coloring. The dramatic color change adds one more facet to the fascination of learning about the foods we consume.
"the accidental science of cooking" website