The first time drug kingpin Tuco Salamanca tries Walter White’s characteristically blue meth on the AMC drama Breaking Bad, his priorities are straightforward: He doesn’t care about color, he just wants to get high. “Blue, yellow, pink, whatever man,” he says. “Just keep bringing me that!”

But as fans of the show already know, White’s business soon becomes all about the blue—from drug addicts to rival producers, everyone wants White’s signature tint.

The fictional meth manufacturer isn’t the only one who understands the importance of drug color—on both sides of the law, it’s a key part of branding. Viagra is famously known as “the little blue pill,” Nexium is marketed as “the purple pill,” and street names for illicit drugs run through the whole rainbow. But there are also subtler and arguably more important roles for drug colorants. They’re not there just to make a drug look pretty.

Tuco may have been surprised to learn, for example, that meth of a different color may have improved his high. Studies have shown that we associate drug colors with specific effects that stretch far beyond brand recognition. Once we’ve tricked our brains into making the association, it actually becomes real. The placebo effect comes into play and the drug is more effective.

Imagine burning your skin and treating the pain with a cream. Is your imaginary cream white? Now picture it red. Would you trust the cream to work as well? If you had a moment of pause there, you’re not alone. Multiple trials—some with placebos, others with active drugs—have shown that patients’ color-effect associations can impact a drug’s efficacy by measuring physical signs like heart rate and blood pressure. Pharmaceutical companies are well aware of these associations and carry out extensive related research when developing new products or rebranding old ones.

Blue pills, contrary to what Breaking Bad may have you believe, act best as sedatives. Red and orange are stimulants. Cheery yellows make the most effective antidepressants, while green reduces anxiety and white soothes pain. Brighter colors and embossed brand names further strengthen these effects—a bright yellow pill with the name on its surface, for example, may have a stronger effect than a dull yellow pill without it.

When researchers take culture into account, things get a bit more complicated. For instance, the sedative power of blue doesn’t work on Italian men. The scientists who discovered this anomaly think it’s due to ‘gli Azzuri’ (the Blues), Italy’s national soccer team—because they associate the color blue with the drama of a match, it actually gets their adrenaline pumping. And yellow’s connotations change in Africa, where it’s associated with better antimalarial drugs, as eye whites can turn yellowish when a person is suffering from the disease. (Interestingly, this is the opposite of the norm. Just like with the burned-skin example, drugs usually work better when their color matches the intended outcome, not the symptoms of the condition they’re treating). Such cultural variances are one reason why a drug may appear totally different in separate countries.

Color also has more a more practical role in drug manufacturing. In light-sensitive products, tints can lend opacity, keeping active ingredients stable. Color, together with shape, also aids drug recognition. This ensures that drugs aren’t mixed up during production or packaging—a scenario that would have terrible repercussions for patient safety as well as brand reputation. And color’s role in drug recognition is equally important at the patient level, preventing accidental overdose by helping patients on multiple drugs to recognize each one. This is most relevant to the elderly, who are often on multiple drugs and may be dealing with complications from eyesight degeneration or dementia. It’s also a bonus to healthcare workers, who have to give out lots of different drugs in a short space of time. Color’s role here shouldn’t be taken lightly; five percent of all United States hospital patients receive incorrect medication.

But color-effect associations can also backfire—while a drug’s hue acts as a mental imprint, reminding people to take their medications, this also means that patients are also likely to stop their medication regimen if drug colors are changed. This is one of the reasons why drug manufacturers ferociously guard their designs and colors with patents, and generic companies try so hard to resemble them.

So no matter what Tuco Salamanca may say in a moment of meth-induced euphora, the choice between blue, yellow, or pink actually matters quite a bit—and it’s anything but random.