Actor Keiynan Lonsdale has opened up about his experiences with racism following his casting as Wally West on The CW's The Flash.

In an interview with the Los Angeles Times about his new film Love, Simon, Lonsdale said his casting as the DC superhero Kid Flash resulted in his first exposure to "online racism." "The character is originally Caucasian [in the comic books], and so when I got cast — they had changed the character in the most recent comic books and his father and sister are black, but people still didn't put two and two together. It was interesting. I was upset and hurt and I couldn't understand it."

RELATED: Legends of Tomorrow Adds Matt Ryan's Constantine as S4 Series Regular

"I think one thing that helped," the 26-year-old Australian actor continued, "and made me sad but it made me realize it wasn't personal — was once I got to set, I found out that Candice [Patton], who plays my sister Iris, had also been receiving it, so I was like, 'Whoa, this is what people do? People care about that?' Coming from Australia, of course we still have racism, but it's different. So it was an education. I needed to experience that. There were definitely things that have tested my emotions, and just learning how to not respond to really awful [stuff], and learning to be like, 'It doesn't matter. I'm good, good exactly as I am.' I learned a lot about that by joining a show."

Lonsdale made his debut as Wally during the second season of The Flash, and is now a series regular on Legends of Tomorrow. Kid Flash first appeared in 1960's The Flash #110. However, following DC's New 52 relaunch in 2011, a new version of the character was introduced in 2014's Flash Annual #3.

RELATED: When Does The Flash Return With New Episodes?

Airing Mondays at 8 p.m. ET/PT on The CW, Legends of Tomorrow stars Arthur Darvill as Rip Hunter, Dominic Purcell as Mick Rory/Heat Wave, Caity Lotz as Sara Lance/White Canary, Brandon Routh as Ray Palmer/Atom, Maisie Richardson-Sellers as Amaya Jiwe/Vixen, Nick Zano as Nate Heywood/Steel and Keiynan Lonsdale as Wally West/Kid Flash.