In the animal world as in fashion, bright color makes a bold statement. The vivid hues of the strawberry poison dart frog declare, “If you eat me, it could be the last thing you ever do!” And that’s no bluff. The one-inch amphibian, native to Central and South America, secretes a substance so toxic that a single drop can kill a bird or snake.

Animals that deploy poison to defend themselves often signal their toxicity with striking color, and in the interest of clear communication they tend to rely on unvarying patterns, such as the monarch butterfly’s signature orange and black stripes. But the poison dart frogs, named for the blowgun darts that indigenous people laced with the toxic secretion, present an exception to this conservative approach. Although many of the frogs have reddish bodies and blue legs, a significant number exhibit colors ranging from brilliant orange-red to neon yellow with spots to ocean blue, and more.

And here’s another thing: About 10,000 years ago, this species looked fairly uniform. But rising sea levels enveloped part of the frogs’ territory in modern-day Panama, creating a series of islands called Bocas del Toro, and the frogs, isolated in different habitats, followed different evolutionary paths. Why did they develop a variety of colors that rival a bag of Jolly Rancher candies?

Molly Cummings, of the University of Texas at Austin, has been studying these questions, and she recently concluded that the frogs’ colorations have been shaped by an unusual combination of pressures to both avoid predators and win mates.

Cummings suspected that, over the millennia, frogs on some islands developed poisons that were more lethal than those of frogs living elsewhere in Bocas del Toro—and that the more poisonous the frog, the more conspicuous its colors. That co-evolution of traits would make sense in the predator-prey world of natural selection. Frogs that are highly toxic can risk being seen if their color loudly warns predators to back off. And frogs whose poison is less lethal would have a better chance of survival if they were less conspicuous.

Cummings and a colleague confirmed this theory by collecting poison dart frogs with ten different color schemes. Next the scientists extracted toxins from each frog’s skin, diluted them and injected the mixtures into lab mice. Several of the mice subjected to toxins from the brightest frogs experienced convulsions and compulsively groomed themselves for hours before the effect wore off and they fell asleep. Poison from frogs that were blander in appearance elicited a less prolonged reaction. A brilliant orange-red creature from Solarte Island turned out to be 40 times as toxic as a matte green frog from Colón Island. Among the poison dart frogs, “dressed to kill” has a literal meaning.

What really matters, though, is how the frogs look to predators. Animals perceive colors differently. Birds see more colors than we do. Snakes view the world in a unique set of shades, including infrared, which we can’t see. “Many different viewers pay attention to color,” Cummings says, “so the question is, who shapes the signal?” Cummings found that, among the various animals that dine on the frogs, only birds have the visual capacity to discern all the frog color varieties. Birds, she says, must have long been the frogs’ most lethal predator, and the Technicolor skin evolved in response to that threat.

But there’s more to a color than just its hue or shade, and the poison dart frog’s evolution takes advantage of that, too. Some frogs that share the same color are brighter than others. And while birds are good at telling different colors apart, they’re not so hot at detecting different levels of brightness. So the intensity of the frog’s coloration must be about sex, Cummings thought.

Cummings discovered that the frogs’ eyes are fine-tuned to gauge brightness, which she theorized is involved in mate selection: Females prefer males with the shiniest skin.

From an evolutionary perspective, the poison dart frogs lucked out, since extravagant physical traits that help males attract a female often make them more vulnerable to predators. Peacocks with long colorful tails are a hit with the ladies, but the tails make it harder for them to fly away from danger.

Not so with the dandiest poison dart frogs, which get to have it both ways: Their flashy colors simultaneously attract mates and warn predators. To the envy of other animals, they didn’t have to sacrifice sex for survival.