When you listen to a lively Mozart piece in a major key, what colors do you see? If bright yellows and oranges swirled in your mind, it wouldn't surprise a group of scientists at the University of California, Berkeley.

Their new study found that people associate upbeat, major-key music with lighter, more vibrant yellow-toned colors, while slower music in minor keys actually gives people the blues.

"The results were remarkably strong and consistent across individuals and cultures and clearly pointed to the powerful role that emotions play in how the human brain maps from hearing music to seeing colors," study researcher Stephen Palmer, a UC Berkeley vision scientist, said in a statement.

"Surprisingly, we can predict with 95 percent accuracy how happy or sad the colors people pick will be based on how happy or sad the music is that they are listening to," Palmer added.

Palmer and his colleagues studied nearly 100 men and women, half in the San Francisco Bay Area and half in Guadalajara, Mexico. The participants listened to 18 varied pieces of classical music by Johann Sebastian Bach, Wolfgang Amadeus Mozart and Johannes Brahms. They also were given a 37-color palette and told to choose five colors that best matched each song.

Overall, most people chose an array of warm colors to accompany the upbeat songs and darker, grayer, bluer colors to go with the more somber ones.

The researchers saw the same pattern when they tweaked the experiment to use facial expressions instead of colors — happy faces were matched with upbeat music in major keys, while sad faces were paired with gloomier tunes. The results suggest emotions are responsible for music-color associations.

The scientists hope to expand their research to study other musical norms and cultures. Next, they plan to recruit participants in Turkey, where traditional music often uses scales beyond major and minor keys.

"We know that in Mexico and the U.S. the responses are very similar," Palmer said. "But we don't yet know about China or Turkey."

The study seems consistent with previous research on color associations. One such study published in the journal BMC Medical Research Methodology in 2010 found that people with depression or anxiety were more likely to associate their mood with the color gray, while happier people preferred yellow.

The new research was published this week in the Proceedings of the National Academy of Sciences and will be presented at the International Association of Colour conference at the United Kingdom's University of Newcastle in July.