In several men’s prisons across California, colored signs hang above cell doors: blue for black inmates, white for white, red, green or pink for Hispanic, yellow for everyone else.

Though it’s not an official policy, at least five California state prisons have a color-coding system.

On any given day, the color of a sign could mean the difference between an inmate exercising in the prison yard or being confined to their cell. When prisoners attack guards or other inmates, California allows its corrections officers to restrict all prisoners of that same race or ethnicity to prevent further violence.

Prison officials have said such moves can be necessary in a system plagued by some of the worst race-based gang violence in the country. Just last week, at least four inmates were taken to the hospital after a fight broke out between over 60 black and Hispanic inmates in a Los Angeles jail.

The labels “provide visual cues that allow prison officials to prevent race-based victimization, reduce race-based violence, and prevent thefts and assaults,” wrote the California Department of Corrections and Rehabilitation, in response to a lawsuit.

But legal advocates say such practices are deeply problematic. “I haven’t seen anything like it since the days of segregation, when you had colored drinking fountains,” said Rebekah Evenson, an attorney with the nonprofit Prison Law Office.

A federal class-action lawsuit filed in 2011 by the Prison Law Office says race-based restrictions are an ineffective and unjust way of keeping prisoners safe. “Rather than targeting actual gang members, they assume every person is a gang member based on the color of their skin,” said Evenson, one of the lead lawyers in the case. According to the ACLU National Prison Project, California is the only state known to use race-based lockdowns.

State and federal courts have ruled against the practice multiple times. One state court judge concluded in 2002 that “managing inmates on the basis of ethnicity” was counterproductive, and instead increased hostilities among prisoners.

A recent review of corrections department reports, done for the Prison Law Office, suggests it’s still common practice. The analysis found that nearly half the 1,445 security-based lockdowns between January 2010 and November 2012 affected specific racial or ethnic groups. Inmates labeled as Hispanic were the most common targets, while inmates identified as “other,” (anyone not labeled black, white or Hispanic) were the least likely to be restricted.

Rejecting an inmate’s complaint in 2010, one prison’s inmate appeals reviewer noted that the department’s “policy is that when there is an incident involving any race, all inmates of that race are locked up.” Another review cited the same policy.

California’s corrections department spokesperson Terry Thornton said that's not department policy. Thornton said policy dictates that restrictions will not “target a specific racial or ethnic group unless there is a legitimate penological interest in doing so."

“A legitimate penological interest is safety, security,” Thornton said. “It’s protecting people’s lives.”

Prisoner advocates say race-based lockdowns may be yet another consequence of California’s crowding crisis. In 2011, the Supreme Court upheld a federal court ruling that crowding in the state’s prisons was severe enough to constitute cruel and unusual punishment, and required the state to cut its prison population.

Prison officials have blamed crowding for contributing to “an increase in riots and disturbances.” And the more inmates there are, the more likely it is that prison officials will respond to violence with broad-brush security measures, legal experts said.

The state prison’s population has dropped recently, though it’s still at nearly 150 percent its designed capacity.

The state’s corrections officer union sided with plaintiffs in the Supreme Court case, claiming overcrowding compromised their ability to effectively run a prison. "Overcrowding in California’s prisons substantially increases the use of lockdowns," the organization wrote in a legal brief.

Certain security situations might require inmates to be kept from the prison yard, prohibited from receiving visitors, or blocked from classes and drug rehabilitation meetings — restrictions the department refers to as “modified programming." Analysis of corrections department reports found that nearly all of security lockdowns last year restricted outdoor exercise.

Hanif Abdullah is one of the inmates suing the state. Currently at California State Prison, Solano, Abdullah asserts he was placed on “modified programming” multiple times solely because he is black. A devout Muslim, he says he was kept from attending religious services as well as receiving adequate health care.

Another prisoner in the suit, Robert Mitchell, claims he was locked down “nearly continuously” for a year and a half at High Desert State Prison, because the sign outside his cell marked him as black. Mitchell testified that he suffered "muscular atrophy … and severe pain" when he was kept from exercising a leg injury.

The state denies that the lockdowns were race-based or unnecessarily long.

Race-based lockdowns may end up being used simply because it’s not always clear-cut who’s in a gang and who’s not. Inmates may side with members of their own race or ethnicity for protection during a fight, without being a member of a race-based gang like the Aryan Brotherhood.

UCLA law professor Sharon Dolovich, who has testified against race-based lockdowns, said identifying the "enforcers" of such gangs would be a more effective deterrent to violence than locking down entire racial or ethnic groups.

Thornton, the prisons’ spokesperson, said the violence of a few inmates has a large impact on the entire prison. "A lot of inmates come to prison and they just want to do their time and go home," she said.

Identifying “enforcers” has challenges. A more targeted approach requires more trained personnel, which may be a tall order for California’s overburdened system. And another lawsuit brought on behalf of California prisoners claims that despite recent changes, prison officials still rely on questionable evidence, such as tattoos or certain books, to determine which inmates are gang members.

Beyond discrimination claims, the Prison Law Office lawsuit alleges lockdowns often last longer than necessary. Forty percent of security restrictions lasted less than a week, the analysis found, and more than 15 percent lasted more than a month. The complaint alleges some have lasted up to 10 years.

In a legal response filed last August, the state denied any lockdowns lasted longer than needed to secure the facility. Corrections spokeswoman Thornton said the department’s policy dictates restrictions “last no longer than necessary to restore institutional safety and security or to investigate the triggering event.”

“Prison administrators are not going to return a yard to regular programming until they know that people aren't going to try and kill each other again,” Thornton said.

After a state appeals court upheld a 2002 state ruling against raced-based punishment at maximum-security Pelican Bay prison in Northern California, officers took a different tack. They began assessing the risk posed by individual inmates to determine restrictions. A prison spokesperson at the time told the Sacramento Bee that violence had decreased as result of the new policy.

The decision was reinforced by a 2005 U.S. Supreme Court ruling that held any use of racial classifications must be “narrowly tailored to serve a compelling state interest.” California prisons were ordered to stop segregating reception centers, where inmates stay for up to two months when they first arrive. In the majority opinion, Justice Sandra Day O’Connor wrote: “When government officials are permitted to use race as a proxy for gang membership and violence ... society as a whole suffers.”

But Pelican Bay returned to race-based restrictions in 2009, according to court testimony from two prison officials. Both testified an unnamed deputy director ordered them “to discontinue this [new] system, as it was ‘against Department policy.’”

The reinstated policy was struck down again in January when a state appeals court in northern California upheld the trial court’s original ruling. “There are more narrowly tailored means of controlling violence than to restrict entire ethnic groups,” the trial judge wrote.

“Prison staff doesn’t have to impose race-based lockdowns in order to ensure security,” said the Prison Law Office’s Evenson. The group is pushing for an injunction to halt the practice across the state.“They’ve gotten used to using it as a convenient shortcut, and prisoners continue to suffer just because of the color of their skin."