What’s black, white and striped all over — except for its head?

Horses wearing zebra coats on a farm in Britain.

The animals weren’t attending a masquerade. They were dressed for studies investigating a mystery that has puzzled scientists for more than a century.

With solid coats of brown or gray, “most mammals are pretty boring,” said Tim Caro, who studies animal coloration at the University of California, Davis, and a co-author of a study published on Wednesday in PLOS One. “So when you see these bold patterns like on a giraffe or zebra, as a biologist you say, Why?”

At least since the days when Charles Darwin and Alfred Russel Wallace were theorizing about evolution, scientists have debated the function of this sassy animal print. It’s been called camouflage to confuse big predators, an identity signal to other zebras and a kind of wearable air conditioner. Now most scientists agree that the function of a zebra’s stripes is to ward off biting flies that can carry deadly diseases.