Peter Kim, one of the writer-performers who recently quit a Second City revue, says it was an audience member’s racial attack of another spectator that pushed him over the edge.

Kim was one of four people in the six-member cast of “A Red Line Runs Through It” to depart the show earlier this month. The others — Lisa Beasley, Aasia Lashay Bullock and Scott Morehead — have not explained their exits publicly.

“All of us left for different reasons, but kind of similar reasons,” Kim told Chicagoist. “We were going through a lot of stress with the show, and I can’t speak to why everyone else left. But for me, I kept trying to find a way to cope.”

In an essay published on the Chicago magazine website, Kim said a prolonged period of hostile treatment from audience members led up to his decision.

“Since September 2015,” he write, “people in the audience have hurled increasingly racist, homophobic, and misogynistic comments at me and my castmates: comments demeaning my Asian ethnicity, using the f-word to degrade my homosexuality, and shouting ‘whores’ at the women.”

As a result, “after a year of continued audience abuse, I started to feel anxious going into work. For six shows a week, I got on stage and made 200 people laugh — but I forgot what it felt like to have fun.”

The last straw was when an audience member seated next to a Hispanic couple responded to a cast request for a suggestion of something irritating by saying, “Sitting too close to a Mexican!”

“I finished the show, downed three shots of bourbon and walked out of the building,” Kim wrote. “I decided to leave a dream job at the mecca of American socio-political satire.”

Kim made a distinction between traditional hecklers, whom he welcomes, and a newer breed of “mutations” using their position in the audience to practice hate speech.

“Until recently, it was taboo to be a racist. You exercised your racism like a gentleman, inside the privacy of your Thanksgiving table or Thursdays at your Klan rally,” he write. “But this year, a presidential nominee of the United States of America gave his tribe a platform and a thinly veiled slogan, then fed them lies to turn them against the ‘others.’ ”

But “I didn’t quit Second City because of Donald Trump. I quit because I am excellent, and I demand excellence from those around me,” Kim concluded, without specifying whether that means audiences, castmates, Second City staff or some combination.

“A Red Line Runs Through It” continues to run with replacement actors.