There is a thin line between edgy and tasteless, between deprecating and demeaning, and ultimately between funny and not. The trick for anybody trying to tell jokes at one of Washington, D.C.’s, many fund-raising galas is to come as close to the line as possible without stepping out-of-bounds.

When the speakers are the chairman of the Congressional Black Caucus and the nation’s only black Republican senator and they are appearing before a ballroom packed overwhelmingly with white members of Congress and white journalists, any wayward jokes can draw that much more attention and be that much more cringe-inducing. That was the case at Wednesday night’s 73rd annual Washington Press Club Foundation Dinner at the Ritz-Carlton Hotel.

Stay undefeated with our culture newsletter

No. Just. No. Enter a real email and try again.

Success! Your inbox thanks you

“She really looked kind of familiar in that position there,” Richmond said, prompting winces throughout the packed ballroom. Perhaps that was a good line for a comedy club crowd, but not so much for the civic-minded folks watching the event on C-SPAN.

Sen. Tim Scott of South Carolina also made light of the Conway photo, noting that the Oval Office has seen more serious breaches of decorum with President Bill Clinton’s intern Monica Lewinsky. “Come on, people! You remember the ’90s. That couch has had a whole lot worse things. Come on now!”

Tough jokes, including some bad ones, are the norm at the dinner, which raises money for the foundation’s work supporting diversity in newsrooms and educating students on the role of the free press. What is unusual is having them delivered by two black lawmakers.

Both men leaned heavily on race in their routines. Scott, for instance, talked about being the only black Republican in the Senate.

“Now you all know that we as Republicans do not believe in affirmative action. We just don’t believe it. However, if you ever get a call from your female Indian governor saying, ‘Does the brother have a minute? I want to talk with you about becoming a U.S. senator’? You say, ‘Yes!’ ”

Scott, 51, was originally appointed to the Senate in 2013 by former South Carolina Gov. Nikki Haley, who is of Indian descent. She is now the U.S. ambassador to the United Nations.

He also joked about the trolls who go after him on Twitter, accusing him of being a racial sellout. “Someone said, ‘You’re just not black enough.’ I said, ‘Have you seen [Democratic Sen. Cory Booker]?’ What is black enough?” He piled on, joking that a television producer wanted to create a reality show about him and the much lighter-skinned Booker called 50 Shades Darker.

Although both Richmond and Scott had their misadventures, they ended on more solid ground.

Scott said, “I hate to speak and run,” but that he had to leave to attend movie night at the White House. “I heard we’re watching one of the president’s favorites,” he said. “From Russia with Love.”

Richmond, 43, closed by lamenting that the Ringling Bros. and Barnum & Bailey Circus announced on Jan. 16 that it was shutting down before his 2-year-old son had a chance to see it.

“I wanted him to grow up seeing elephants and clowns and a three-ring circus,” he said. “Then four days later, 45 was sworn in as the president of the United States and we are going to make the circus great again.”