We all know ancestors give us our hair color, but the roots of gray hair have been less clear. Is it genetics, or stress?

Marie Antoinette supposedly went completely white the night before they lopped off her head. And our presidents seem to go gray much faster than those of us with less weighty roles.

It turns out you can blame Mom and Dad, at least a bit. Scientists say they've identified the first gene for gray hair.

The variant, dubbed IRF4, is also associated with blonde or lighter-colored hair. That makes sense, because melanin is the pigment that paints hair with the chestnut, golden or raven hues of youth. With age, the melanocytes that produce the color in hair follicles can slow down. And you start going gray.

"You think about hair graying as the absence of melanin," says Kaustubh Adhikari, a statistical genetics postdoc at University College London and lead author of the study, which was published Tuesday in Nature Communications.

Gray hair is more common in people of European origin, as is lighter hair. That makes sense, Adhikari says. "You would sort of think of hair graying as an unintended consequence of selecting for this hair color." In other words, if you decide to marry a blonde, don't be surprised if your kids someday turn gray.

People of Asian and African ancestry also go gray, but less often than do Europeans. "You would expect that they would have genes that influence graying," Adhikari says. "We just haven't found them yet."

The scientists discovered the gray gene by studying the scalp and facial hair of 6,630 volunteers in Brazil, Colombia, Chile, Mexico and Peru. The researchers took photographs and asked about natural hair color. The participants had a mix of European, Native American and African ancestry.

Then the scientists performed genetic analyses called genome-wide association scans that look for common variants, and matched them with appearance.

Ten new variants popped out; gray hair was matched with one. Others influence unibrow, balding, eyebrow thickness and hair structure.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.