The rainbow-colored crosswalk paint gleamed in the late-morning sunshine Thursday as a dozen or so police officers directed traffic around the event.

“Fifty years ago, it was against the law for homosexuals to congregate. The police would arrest us,” said Stu Zirin, vice president of the Northalsted Business Alliance, standing at the corner of Halsted and Roscoe streets.

The city’s gay community — approaching the 50th anniversary of the Stonewall riots — celebrated the official unveiling of seven rainbow crosswalks (14, when the project is complete) in Boystown on the North Side.

The Stonewall riots began June 28, 1969, after a police raid of the Stonewall Inn, a gay bar in Manhattan. The uprising spawned an international gay rights movement.

“As we step onto the crosswalks, we have to remember our history and how hard it was — as we look forward to a bright future,” Zirin said.

Zirin was among two dozen guests, including other business leaders and city aldermen. Few were talking about the multi-hued paint.

“Back in the 1980s, I used to be a teacher,” said Ald. James Cappleman (46th), who is gay. “I left the teaching profession because a colleague of mine was fired for being at a pride parade. I knew I was going to be next.”

Art Johnston, co-owner of Sidetrack, a gay bar that opened in Boystown in 1982, has been a gay-rights advocate since 1975.

“The average life of a gay bar, when we opened . . . was two years because of the harassment from the city, from the police, from the powers that be — [it ] was contant, constant, constant,” said Johnston, 75. “We were simply not wanted.”

The crosswalk project will include a blue-pink-and-white transgender version. The $60,000 project will be paid for with money donated during Chicago Pride Fest and North Halsted Market Days, according to the business alliance. The project is expected to be completed in time for this year’s Pride Fest, which starts June 22.