When actress Candice Patton was cast as Iris West on the CW series “The Flash” back in 2014, she was not sure what she was jumping into.

She knew the basics: Iris West was a classic DC Comics character (debuting in Showcase No. 4 back in 1956). She’s one of the most important women in the DC universe, and the status of her on-and-off romance with the Flash always has an impact on his heroics.

But Patton says she wasn’t prepared for the fanboy blowback she got for being an African American actress cast in a role that had always been a white woman.

Actors of color had taken on white comic-book roles before. Samuel L. Jackson is Nick Fury in Marvel Studios’ movie machine. Lawrence Fishburne played Daily Planet editor Perry White in the 2013 Superman movie “Man of Steel.” Patton figured her casting wouldn’t be a big deal because of her race.

“I think I was too naive … to prepare for what was coming,” Patton told The Post’s Comic Riffs while in Washington for the DC Comics event “DC in D.C.” on Saturday. “I think it was shocking when I got the role and understood that a lot of people weren’t happy with it. Not a lot, but there was this subset of people that didn’t want to see that. But change is difficult for people, as we’re noticing in our political climate. People are always going to fight against change. But I think I’ve kind of solidified the role, and it doesn’t bother me anymore.”

“Now, it’s just kind of set in stone that I’m Iris West,” Patton added. “That’s a really cool thing that young girls [of color] can see themselves as the ingénue.”

“The Flash,” currently airing its fourth season on the CW, originally spun off from the CW’s “Arrow” and has turned into arguably the network’s most popular superhero show. Patton’s Iris West recently married the titular hero Barry Allen (played by Grant Gustin) at the end of an annual crossover that involves four of the CW’s DC-inspired shows (including “Arrow,” “Supergirl” and “Legends of Tomorrow”).

The news comes after three seasons of “will they, won’t they” and both characters having other romantic interests. But Patton says she doesn’t think there will be any less drama in their lives.

“We’ve had three years of bumps between Barry and Iris so I’m happy that they’re finally married and in love and everything seems to be going well,” Patton said. “I think they’ll be conflict outside of themselves and that will be enough to entertain viewers hopefully. As far as Barry and Iris, I always want to see them as a solid unit.”

As for those crossovers between “The Flash” and the CW’s other superhero series that now film in Vancouver annually, Patton says to enjoy them, because they’re not easy to make.

“The scheduling is the hard thing. I don’t know how we do it every year,” Patton said. “And every year it’s bigger and more complex. And every year I think we all get really, really nervous around that time. We know we’re not going to be sleeping. We’re all going to be a little grumpy. It’s very difficult. A lot of coffee [is involved].”

One crossover Patton won’t have to worry about is “The Flash” characters entering the DC movie universe, which was a hot rumor when “The Flash” began airing. There were many fans hoping it would happen. Patton says “The Flash” cast knew right away it was never meant to be.

“I think we kind of knew very early on that the TV and film world were going to be very separate, unlike the Marvel universe, where they’ve kind of bled over,” Patton said. “Also, we shoot 23 episodes a year, nine months out of the year. I don’t even know how we could find the time to film a movie and also do the show.”

Those rumors ended quickly when Ezra Miller was cast as the Flash in “Justice League” shortly after the Gustin-starring CW series began. But the show had one strong influence on casting in the Scarlet Speedster’s future movie universe: an African American actress, Kiersey Clemons, was cast as Iris West in the Flash movie, which is now reportedly being directed by John Francis Daley and Jonathan Goldstein. Patton says she’s proud her casting might have had something to do with that.

“If my casting wasn’t working, they would have changed it for the film,” Patton said. “Generations after this will remember Iris West as black, whether that’s me, or someone else playing [the role] in the film. It’s a great thing.”

Read more: