For the first time, researchers have identified a gene that's involved in hair turning grey. And only people with European ancestry carried it, which could explain why some people can keep their nature colour into old age, while the rest of us start seeing grey hairs before our 30th birthdays (thank you, parents).

Scientists have long understood how our hair turns grey - as we age, stop producing as much of a pigment called melanin - but they haven't been able to figure out why, or, more importantly, how to stop it. Understanding the gene involved in the process could change that, and could potentially lead to new treatments to avoid grey hair altogether.

"We already know several genes involved in balding and hair colour but this is the first time a gene for greying has been identified in humans, as well as other genes influencing hair shape and density," said one of the researchers, Kaustubh Adhikari, from University College London.

The study looked at the genomes of more than 6,000 people in Latin America who came from a diverse range of backgrounds, including African, European, and Native American.

By scanning their DNA and comparing it to their appearance, researchers were able to identify 18 genes that appear to influence hair traits - including grey hair, beard thickness, whether hair is curly or straight, and even whether or not someone will develop a unibrow.

The gene found to be linked to grey hair is called IRF4, and it's been shown in previous studies to be influence the production of melanin. But this is the first time anyone has been able to associate it with grey hair.

"It was only possible because we analysed a diverse melting pot of people, which hasn’t been done before on this scale," said Adhikari, adding that the findings have "cosmetic applications as we increase our knowledge on how genes influence the way we look".

You can see all the newly identified genes and their associations below:

University College London

To be clear, it's unlikely that genes fully control our hair, and environmental factors also have a big influence on whether or not we go grey, how thick our hair is, or whether it's curly or straight.

"It’s not like you have that [gene] variant, so you’re certain to have gray hair," lead researcher Andrés Ruiz-Linares told The Verge. "No. It basically increases your chances relative to the general population."

But if we can understand how genes are involved, we can better understand how to control certain traits - such as slowing down greying or preventing baldness - and also figure out how they evolved in the first place.

"It has long been speculated that hair features could have been influenced by some form of selection, such as natural or sexual selection, and we found statistical evidence in the genome supporting that view," said Adhikari.

The next step is for the team to study IRF4's specific role in stopping melanin production, so that they can eventually work on slowing down or preventing the greying process.

Aside from the cosmetic applications, the research could also help forensic scientists and police piece together what a suspect looks like based on their DNA - for instance, whether they have grey hair, and whether it's straight or curly.

But let's not kid ourselves, we're selfishly hoping they figure out the grey hair thing first. Thanks in advance, scientists.

The research has been published in Nature Communications.