The American state of South Carolina’s prisons director has defended a two-year-old policy of making detainees who perform sex acts in front of prison officers wear pink.

An inmate has brought a lawsuit, claiming the colour pink puts prisoners in danger.

The punishment is designed to protect female prison staff from sexual behaviour.

Inmates are made to wear pink uniforms for three months if they are judged to have performed a sex act in front of a prison staff member.

“We don’t believe the United States Constitution protects an inmate’s right to publicly gratify himself,” State Corrections Department John Ozmint said, according to the San Jose Mercury.

In some jails in the state, prisoners who break the sex act rule are placed in an area where women prison staff do not work.

Lawyers for the state prisons department have asked the lawsuit be thrown out.

“Of course you should protect staff from sexual harassment, but there are other ways to do it besides this degradation and putting people at risk,” Jamie Fellner, U.S. director of Human Rights Watch told the Mercury.

Meanwhile an man serving a life sentence for sex crimes against a child in North Carolina is attempting to sue prison officials for denying him access to gay magazines The Advocate and the New York Blade.

Prison officials said magazines that pose a security threat or that describe violence, criminal activity or sexually explicit behaviour are banned, according to the Santa Barbara News Press.

“We have had many letters from prisoners complaining that magazines and other publications were being kept from them for what seem to be arbitrary reasons,” J. Phillip Griffin, an attorney with Prisoner Legal Services, told the paper.

“Their constitutional rights are balanced against the fact that they are prisoners and the institutional needs – such as the need for security and order in the prison.”