From red to white to orange to blue, fish flesh can land almost anywhere on the color spectrum.

What’s behind this huge variation? A lot of things — from genetics to bile pigments. And parsing the rainbow can tell us something about where a fish came from, its swimming routine and what it ate.

A yellowfin tuna caught in the Gulf of Mexico; a yellowfin tuna steak. Photos: NOAA/Flickr;Chang/iStockphoto

Red Yellowfin tuna: A classic of the sashimi counter, the yellowfin tuna is also the Michael Phelps of the fish world. And its athletic prowess has a lot to do with its ruby red flesh.

Bruce Collette, a zoologist with the National Marine Fisheries Service, tells The Salt that the endurance swimmer tunas need lots of oxygen to feed their muscles. The molecule called myoglobin that carries oxygen through the bloodstream and into the flesh also acts as a muscle pigment, turning the flesh of most tunas, and other open-ocean fishes like mako sharks and swordfish, pinkish red.

“It’s true of land animals, too — if they’re walking around a lot, they’ll have more myoglobin and their meat will be darker,” Collette says. But as Michaeleen Doucleff has reported, more muscle activity also makes meat tougher. That’s why the lazy belly muscle of the tuna, known as otoro, is exceptionally soft.

The pigmented flesh in tuna occurs throughout the body but is concentrated in a head-to-tail strip of brownish flesh along each side — strong-tasting meat that’s often discarded.

But take heed: Some sneaky seafood hawkers artificially enhance the color of tuna meat by exposing it to carbon monoxide gas. This method restores meat that has faded to an over-the-hill brown back to a fresh, luscious red. The practice is illegal in some nations, such as Singapore, but not in the U.S. So be wary of any tuna cut that seems just a tad too cherry-red to be real — it could be less fresh than advertised.

Off-White Pacific Halibut: While dark red muscle is associated with long-distance swimming, the off-white, almost colorless flesh of most fishes signals a life of languid swimming and idleness.

The thickly muscled Pacific halibut has coveted flanks of choice white meat, which come in handy for short bursts of activity. But it spends much of its time either slowly moving or at rest on the seafloor — the opposite of a tuna.

When halibut meat is raw, it isn’t actually white but rather glossy and translucent. But cooking the flesh causes proteins in the meat to coagulate, creating that dense, snow-white color and firm texture we see in so-called “white meat fish.” A similar process occurs in all types of meats from both land and sea. And it’s why tuna flesh turns grayish when cooked, why salmon goes soft pink and why beef becomes brown.

Orange Chinook salmon: Salmon flesh owes its brilliant pink-orange hue to a unique combination of genetics and diet. Milton Love, a biologist with the University of California at Santa Barbara and author of Certainly More Than You Want to Know About the Fishes of the Pacific Coast, says that when salmon eat krill, a major part of their diet, pigments called carotenoids in the crustaceans turn the fish’s flesh orange.

Why doesn’t this happen to all krill-eating fish? Love explains that salmon contain a “color gene” that allows the carotenoids to show through in their muscle tissue.

However, among Chinook, or king, salmon, some individuals lack the color gene, and as a result, the occasional Chinook has grayish-white meat. Called “ivory kings,” such salmon can reportedly draw a higher price than red-fleshed salmon at retail markets. However, Tom Worthington, co-owner of the Monterey Fish Market in San Francisco, sometimes has to drop the price a tad to move his ivory king fillets. “That red color of salmon is so attractive to consumers,” he says. “Ivory salmon can be a really tough sell.”

Blue Lingcod: Though usually white-hued like halibut or cod, lingcod, a West Coast bottom-dwelling species, occasionally looks as though it’s been marinated overnight in a tray of Blue No. 2 food dye.

Love writes in his book that a bile pigment called biliverdin seems to be responsible for turning the blood serum of these fish their stunning color — but how this pigment gets into the tissues and flesh of the fish, or why only some lingcod turn this striking shade, is a mystery to biologists.

Lingcod — which are a member of the greenling family — aren’t the only West Coast species to turn up with blue-green meat. Its cousins, the rock greenling and the kelp greenling, are sometimes tinted turquoise, as is an unrelated sculpin called the cabezon, which shares the same habitat.

Worthington says the rare turquoise individuals taste the same as their white brethren. And during cooking, the blue color vanishes entirely. Those lucky enough to encounter a blue fillet at the fish counter may drawn to it for its aesthetic appeal; Worthington says turquoise lingcod fillets always sell faster than their white counterparts.

Are there any fish we’ve left out? Let us know if you have other brilliantly hued suggestions for the fish rainbow.

Alastair Bland is a freelance writer based in San Francisco who covers food, agriculture and the environment.