It’s no secret there’s widespread racism in Mexico, but a new study shows the surprising precision with which skin color can determine socio-economic status.

The darker the skin tone, the less upward mobility a Mexican can expect to have, according to the paper (link in Spanish) which was released earlier this month by Mexico’s National Statistics and Geography Institute (INEGI).

The findings are based on a 2016 survey that asked respondents to match their skin to a palette of 11 shades, with A being the darkest and K the lightest. The answers they gave to questions about their economic status were then tabulated by skin tone.

PERLA INEGI used a palette developed by Princeton University’s Project on Ethnicity and Race in Latin America.

The experiences of the people at the opposite ends of the color spectrum were starkly different. Mexicans with the darkest skin colors are far less likely to finish elementary school.

Meanwhile, those with fairer skin are more likely to have a university education.

The same relationship between skin color and economic opportunity holds true with jobs. Lighter-skinned people tend to be in positions of power, while darker-skinned people have jobs that require fewer qualifications.

The results can only be an approximation of skin-tone based inequality, since they are based on the respondents’ own perceptions. Mexicans have a complicated relationship with melanin concentrations and may not be the best judges of their own skin color, as the video below shows.

Children are asked to pick between a white doll and a brown-skinned doll. All of them like the white one best. When asked which one looks more like them, they are reluctant to identify with the brown doll. (In a telling sign about Mexicans’ views on race, the people who put together the video had to paint a doll because they couldn’t find one with darker skin for sale.)

Still, there are signs that Mexicans are becoming more aware about the tight links between skin color and class, and more willing to talk about them—even if the conversation may at times seem crass, such as the Skin-O-Meter, which creates memes lampooning Mexican attitudes toward skin tone.

There are also more empowering attempts to bring attention to the problem. For the first time ever, an indigenous Mexican woman is running for president.