It was easy to get confused trying to guess what President Donald Trump would do about the young people brought to this country illegally as children. Would he act on his professed love of those known as “dreamers” or cater to his hard-line anti-immigrant base? Would he listen to Paul Ryan or Jeff Sessions? Would he side with business executives or Breitbart?

But it’s not really hard to tell what Trump will do on any issue. Just ask: What would a white racist do? If you can answer that question, you have a good idea which way Trump will go.

His record on the campaign trail and in office shows a clear pattern. He said Mexican immigrants are “bringing crime. They’re rapists.” He called for “a total and complete shutdown of Muslims entering the United States.” He said the Indiana-born judge presiding over a lawsuit against Trump University was unfair because “he’s a Mexican.”

He accused China and South Korea of stealing our jobs. His budget included cuts in funding for prevention of HIV and AIDS abroad. He wants to reduce legal immigration by half. He pardoned former Arizona sheriff Joe Arpaio, who was found guilty of illegal racial profiling.

More recently, Trump exhibited a strong reluctance to disown the white supremacists who marched in Charlottesville, Va. After finally coming forth with a condemnation of neo-Nazis and their ilk, he backtracked, blaming “both sides” for the violence.

There is a single, unmistakable thread running through this entire fabric: race. The people he attacks or shortchanges are almost always nonwhite. And the pattern is too consistent to be accidental. What has Trump done, after all, that a white racist would not have done?

Some of his views are not subtle at all. Last year, he insisted that five black teens were guilty of a brutal 1989 sexual assault in Central Park — even though DNA evidence had exonerated them. After David Duke endorsed him, Trump claimed he knew nothing about the neo-Nazi leader — whom he had publicly criticized as recently as 2000.

“Sad to see the history and culture of our great country being ripped apart with the removal of our beautiful statues and monuments,” he tweeted last month, referring to Confederate memorials. “Culture”? Trump was born in Queens and has lived most of his life in midtown Manhattan. His cultural roots are far removed from the people who erected those monuments.

He’s never shown an affinity for things that are especially popular in the South — college football, church, NASCAR, hunting, fishing, country music, barbecue, you name it. What he has in common with the Southerners who worship Robert E. Lee is not culture but complexion.

There is, of course, one person widely reviled by Republicans as well as Democrats who escapes Trump’s criticism. But then, Vladimir Putin is as pale as Siberian snow.

It’s not entirely clear whether Trump is a privileged ignoramus whose life has blinded him to the perspective of nonwhites or a conscious bigot who regards various minorities as inferior. But it doesn’t really matter what’s in his heart. It’s enough that his public conduct is so consistent with outright racism.

That compatibility is not lost on whites who are fearful and resentful of blacks, Latinos and Muslims. His appeal to this group was crucial to his political rise — which began, remember, with his fraudulent questioning of Barack Obama’s birthplace.

It was Obama who made Trump possible, because having an African-American in the White House supercharged white fears. Whites who dislike interracial dating were no more likely to vote Republican than Democratic before Obama. Once he became president, this group moved en masse toward the GOP.

Trump took advantage of the shift. His loaded language and hard-edge positions were perfectly calculated to attract white voters who feel threatened by minority groups.

He has lived up to their expectations, and his order to end the Deferred Action for Childhood Arrivals program didn’t disappoint. Sessions managed to tie DACA to “crime, violence and even terrorism.”

Though Trump indicated he would be willing to consider legislation to protect the dreamers, Congress isn’t likely to pass it — and there is no guarantee he would sign it. His promise to “revisit this issue” if Congress fails to act is meaningless. Not surprisingly, David Duke was pleased with Trump’s DACA decision.

You don’t have to be a white racist to be satisfied with Trump’s presidency. But it certainly helps.