In an interview with UK LGBT glossy Attitude, out actor Matt Bomer said that coming out gay “cost” him opportunities in Hollywood.

Bomer, 42, is currently promoting his latest project, Netflix's upcoming gay drama The Boys in the Band.

Ryan Murphy's adaptation of Mart Crowley's play of the same name arrives on Netflix on September 30.

(Related: Netflix releases first trailer for gay drama Boys in the Band.)

Bomer said that filming Boys in the Band was a “freeing experience” because of its all-gay cast.

“It was such a freeing experience to get to tell a story with an entirely gay ensemble and creative team,” Bomer said.

“There are often times on set where I am the only openly gay person there, and I’ve learnt how to manage that and do the work – but it was so nice to have this collective experience together and a shared sense of who we are, and who we want to be, and an understanding of each other.”

"I think that really informed the work,” he added.

Bomer, who is best known for playing con-artist Neal Caffrey in USA Network's White Collar and Ken in Magic Mike and its sequel, Magic Mike XXL, came out in 2012. He is raising three children with husband Simon Halls.

“There are definitely more opportunities for gay actors than ever before – but there’s still a price to pay for being out,” Bomer said.

"We’re living in a day and age where there are actors and athletes and public figures who are openly gay and have been unafraid to acknowledge that. But without a question, there’s a trade-off, in my experience."

"I came out at a time when it was very risky to do so – I had a studio film that was about to premiere, and a television series coming out. But to me it was more important to be my most authentic self, both for my family, and for myself."

"I wasn’t trying to be a role model, nor am I now, but I thought if it could help just one person, then it would be worth it. But to say that didn’t cost me certain things in my career would be a lie. It did. To me that trade-off was worth it. But it hasn't been some fairy tale – no pun intended,” he added.