Whether we buy it at a drugstore or at a salon, hair dye can make a big difference in how we feel about our appearance—but how safe is it?

There are ongoing questions about whether or not hair dye increases cancer risks, with at least two studies linking permanent hair dye with increased likelihood of breast cancer in Black women. There are also significant allergy risks associated with hair dyes, and many people are bothered by fumes from the chemicals.

That’s why postdoctoral fellow Claudia Battistella and fellow researchers at Northwestern University in Chicago set out to invent a new kind of hair dye using synthetic melanin, which their lab was already trying out for other applications such as skin protection.

“The idea of using synthetic melanin as hair dye came to my mind while talking with a friend and colleague, a visiting scholar from Italy. I started joking about it, but a few minutes later I was already in the lab setting up the first experiment,” she told Medical Daily .

Our bodies produce the pigment melanin to give us color in our hair, skin and irises. The loss of melanin as we age is what leads to gray or white hair. So, it stood to reason that if the team could produce synthetic melanin that would “stick” to hair, the dye would have a much lower risk of allergic reactions and could avoid some of the harsher chemicals (like ammonia) often used as a base in traditional hair dye.

Lead researcher Nathan C. Gianneschi, PhD said, “The same molecules that your cells use to make those pigments can now be used outside of cells using our process. This involves amino acids, which are the building blocks of life. We use those amino acids and an enzyme to form pigment particles that are very similar to natural melanin.”

They recently published the results of their experiments in the journal Chemistry of Materials .

The process is similar to a regular salon dye job (though it can take longer for the color to set) but is milder and lasts about 18 washes. The synthetic melanin coats hair fibers and can protect it from sun damage, as melanin acts as a natural sunscreen. The research team has succeeded in making dramatic light-to-dark changes (from blonde to browns and reds) and can also go from dark to light shades by adding a small amount of hydrogen peroxide to the mix.

This range of colors gives an advantage over henna, another more natural alternative that’s limited to red- and orange-based hues. While synthetic melanin can’t generate greens or blues, it can produce a full spectrum of natural hair colors.

After they perfect their process and finish trials, the researchers’ next step is to seek FDA approval to market these hair dyes to salons. This new generation of hair color may be a safer alternative that can help those who’ve had bad reactions to traditional dyes, or who just want a more natural approach to beauty.

Jenna Glatzer is the author or ghostwriter of more than 30 books, including Gratitude in Motion with Colleen Kelly Alexander.