President Obama, First Lady Michelle Obama, and daughters Malia (L) and Sasha (R) pose for a family portrait in the Rose Garden of the White House on Easter Sunday in 2015. (Handout/Getty Images)

This is when grace leaves the White House.

Without talking about politics or policy, without getting into race or class, red or blue, the Obamas set a remarkable standard for personal decency and civility during their years as our first family.

The Obamas came in making history, changing America on Day 1. They were the first African American occupants of the country’s most famous address, a home slaves helped build.

Few families have faced such scrutiny. Would they be too black? Would they be too white? How on earth would they satisfy a nation of people who cry with joy at the sight of their faces and want them dead because of the color of their skin?

Their eight years in the White House were a master class in dignity and tolerance.

Celebrating victory in 2008, President-elect Barack Obama and his wife, Michelle, wave, accompanied by their two daughters, Sasha, then 7, and Malia, then 10. (Jae C. Hong/Associated Press)

And it’s easy to forget that now.

Because now is the time, in the final hours of a presidency, when the historians and pundits measure a commander in chief’s legacy on the abacus of accomplishment. And political Washington is busy either dismantling or defending eight years of President Obama’s policies.

The Affordable Care Act, the Paris climate agreement, the Iran nuclear deal — all of these are under attack from President-elect Donald Trump and the Republicans in Congress. Much of it could vanish.

And if that’s the case, what were those eight years for?

The arc of history bends toward a different and enduring legacy that Obama and his family leave: decency.

There have been no terrible scandals. No Lincoln bedroom shenanigans, no blue dress, no Watergate plumbers, no psychics, no Teapot Domes. No strippers, no divorces and no children born of extramarital affairs (did you know that five presidents had those?).

Maybe we’ve lost all shame. Maybe we demand so little of ourselves and our elected leaders that we are thunderstruck when we encounter people who don’t behave like Real Housewives or Kardashians.

(Claritza Jimenez,Danielle Kunitz/Photo: AP/Chuck Kennedy/Pool, Video: The Post)

The Obamas maintained their poise in the face of relentless bile. Over the past eight years, it was impossible to speak or write a single word about the family, the Oval Office, the White House or even their dogs without a blast of racially charged, historically repugnant hate coming their way.

[The Obamas: Refusing to give in to the haters after years of threats and abuse]

The president was depicted in cartoonish tribal costumes, the first lady Michelle Obama was called an ape in heels, football fans thought it would be funny to dress as the president in a noose.

Dozens of people have been indicted on charges of threatening to harm the Obamas since they moved into the White House. In 2011, a gunman fired at the family’s home, lodging seven bullets into the walls when one of the Obama girls and her grandmother was home. A fence jumper armed with a knife made it past security and all the way into the home before he was tackled by an off-duty agent.

The numbers vary, but some security sources said that threats against the Obama family were three times as many as other first families faced.

The biggest scandal in the White House while they lived there was the Secret Service’s breakdown in protecting them.

And facing all that, they never lashed out. They never tweeted their anger, derided their enemies or hit back with something harder and nastier.

“When they go low, we go high,” Michelle Obama said repeatedly. And she meant it.

The family’s refusal to engage in ugliness was almost old-fashioned in a world dominated by what my Post colleague Sarah Kaufman calls the “grace gap.”

“Our impatient, fragmented, competitive society conspires in many ways against gentleness and understanding. Popular culture stokes delight in humiliation and conflict,” Kaufman wrote in her book, “The Art of Grace.”

American society is increasingly defined by the Me Generation, the Be Yourself Generation and the reality show puppeteers.

It’s a selfie, manspreading, mean-spirited culture — and the attack on civility is being led by the next occupant of the White House.

One of mankind’s oldest books, written in Egypt 4,500 years ago by a pharaoh’s adviser named Ptahhotep, is an early Miss Manners column on how real leaders should behave, Kaufman says. “If though be powerful, make thyself to be honoured for knowledge and for gentleness,” Ptahhotep wrote.

That gentleness earned President Obama plenty of scorn from those who read it as weakness.

But it’s no secret that the pulled punch and the turned cheek take far more courage and character than a reptilian lash-out.

No, instead of petulance or cowardice, the Obamas taught us decency, forgiveness, courage — values that are the bedrock of American greatness.

The nation has seen grace. And now more than ever, we must remember it.

Twitter: @petulad