AS ALEX SEGURA has segued professionally from various roles as editor and publicist and mystery-novel author, one constant has been comic books.

For years, the New York-based Segura was the publicist for DC Comics. He now serves in that some role at Archie Comics, where he’s also the editor of Archie’s Dark Circle imprint. And he emphasizes that when comic books became central to his work life, he needed a creative outlet after a long workday.

And so he naturally turned to writing.

“At DC, you get your stack of comics, there’s no hobby to it — it’s your job,” Segura, 36, recalls of his early days as a publicist. He was hired at DC Comics, then based in New York, a decade ago, after working as a journalist at the Miami Herald and South Florida’s Sun Sentinel.

(courtesy of Polis Books 2016)

Segura had been an avid comic-book reader since his Florida youth, but working in the business certainly changed his outlook.

“You have to become a student of [comics] more than a fan,” Segura tells The Post’s Comic Riffs. “So I ended up rediscovering my love of mysteries and crime novels. Those stories that clicked with me and got me thinking of doing [mystery writing] myself were the more modern books, and featured not necessarily detectives wearing a fedora and sitting in their office kind of way, but very flawed characters and very distinct settings.”

Years of working with some of the top comics writers around, though, did provide Segura with an opportunity to see how some of the industry’s best turned their tales into published work. Absorbing those lessions, Segura got his first mystery novel, “Silent City,” published by Polis Books in 2013. His follow-up book, “Down the Darkest Street,” hits shelves today.

“I learned a lot just watching editors at DC and now at Archie,” says Segura, noting such elements as “what they look for in a good story.”

“I think those things were super-influential in the writing of my first book, and the second one, too,” Segura says. “Everyone always asks: What’s the difference between a comic-book story and a prose story? It’s very different in how you get there and what the end result is, and how it’s digested. But the story itself has to succeed on the same merits. It has to be engaging. It has to have a compelling character.”

His career at DC, in fact, provided a range of useful tips and firsthand lessons.

“Working with great writers at DC — people like Geoff Johns, Scott Snyder, Brian Azzarello and Greg Rucka, Gail Simone — I spent a lot of time being the publicist for them, [so] you pick up stuff,” Segura says. “How they carry themselves. What their work ethic is like. And what their stories are like. They become influences in different ways, but they definitely play a part in how I write and how I approach a story.”

Segura’s mystery novels are set in Miami, where Segura grew up as the son of Cuban immigrants. His protagonist, Pete Fernandez, is a forever down-on-his-luck Cuban private investigator and burned-out ex-sportswriter who is never far from hitting the bottle.

Knowing that most people associate Miami with beaches, bikinis and a hot nightlife, Segura views his Pete Fernandez mysteries as a chance to depict a lesser known side of that city.

“I felt like this was a different take, and I didn’t want to talk about Miami in the ‘Miami Vice,’ ‘Scarface’ way — the Miami [that] people see in movies — because there’s so much more” to the city, Segura says.”It’s a pretty suburban/urban sprawl. There’s a lot of wrinkles and corners that I don’t think come up if you go to visit as a tourist.”

Just as the mainstream comics industry has recently increased its efforts to diversify its characters and creators, Segura says that he takes pride in being a Cuban writer telling the story of a Cuban American private eye. Pete Fernandez isn’t the first Latino to appear in a mystery novel, but Segura is happy to add his creation to that list.

“It’s really important to me, and it was really important when I was coming up with this series, that the character be Cuban American — that he reflect kind of upbringing I had,” Segura says.

And how does he find time to write while still working in the deadline-heavy comics industry? Segura — who’s also a new father — says that the key is to document his moments of inspiration.

“It’s usually [writing on] nights and weekend, and it’s odd hours when people are asleep and I happen to find myself awake,” Segura says. “If you followed me around, you’d see that I have a weird process. Something will hit me and I’ll jot it down. I’ve got a pad by my bed just in case I wake up with [an idea]. I go to bed and I say what’s this next scene going to be.

“The worst feeling is falling asleep and losing an idea,” he continues. “It’s really just down time and trying to maintain work, life, balance, but still also get this down, because it’s a passion thing.”

Segura’s initial plan was to write three Pete Fernandez mystery books for Polis and then continue his work with comics. But upon completing the writing on the third book in his Pete Fernandez series, Segura says he’s already come up with an idea for a fourth book, and maybe even a fifth.

In other words: He is beginning to realize that just like his work with comics, perhaps Pete Fernandez isn’t going anywhere any time soon.

“Pete, to me, is a guy I maybe went to school with and lost touch with,” Segura says. “He’s a little bit of a screw-up, but he means well. He’s a good guy. He’s smart. If only he would get his act together, he’d probably be a really good detective.