Queen Elizabeth II is ­famously obliged to keep her political views — including ones about Brexit and other world leaders — to herself. But that doesn’t stop Great Britain’s monarch from throwing subtle shade via her fashion choices.

“What she cannot overtly say with language she secretly says with clothes,” writes London journalist Sali Hughes in her new book, “Our Rainbow Queen: A Tribute To Queen Elizabeth II and Her Colorful Wardrobe” (Plume). “Truly, Elizabeth II’s trolling through fashion could inspire an assassin.”

Take, for example, when Her Majesty wore a blue and yellow outfit — the colors of the EU flag — to the opening of British Parliament after the controversial Brexit referendum in 2016, seemingly signaling her disapproval.

“There were yellow flowers in a circle around the brim of her hat,” said Hughes. “I think it was a reference to the [flag of the] European Union.”

She also seems to show favoritism through fashion: In July 2018, when meeting with Donald and Melania Trump at Windsor Castle for the first time since the president was elected, the queen accessorized with a sizable brooch — that happened to be a gift from Barack and Michelle Obama.

Hughes also points to the time that the queen, now 93, wore a “polite silk head covering” in deference to the culture of Crown Prince Abdullah of Saudi Arabia, but let her power be known as she drove him around in her Land Rover. “[He was] mortified . . . having to sit next to a female driver for the first time in his life,” writes Hughes.

And although the author admitted that such subliminal messages “would never have [been] confirmed or denied by Buckingham Palace,” she added that “we do know that there are no accidents or mistakes in what she wears.”

That includes her handbags, which she uses as secret codes to her staff. The queen places her purse on the floor if she wants to remain conversing with a dignitary. If it’s put on a raised surface, such as a table, it means that she needs to be immediately “rescued” from the situation.

Although rumors abound that she never carries money, Queen Elizabeth II in fact always has an ironed and folded bank note for church-service collections. Other items reportedly in her bag include a small camera, a suction-mounted bag hook so she always has a place to hang her purse, a crossword clipped from a newspaper, mints and a cellphone for calls to her grandchildren.

And she is never without a tube of her signature pink lipstick, by Elizabeth Arden or Clarins, which has scarcely altered since her late teenage years. (During a visit with former first lady Laura Bush, Her Majesty proclaimed that lipstick can be applied publicly at lunch.)

The queen’s love of color-blocking has a purpose: She likes to wear outfits in one hue “for maximum impact so that people can see her.”

They definitely take notice. At her 90th-birthday celebrations in 2016, the 5-foot-3 royal went large in zingy neon lime — launching the trending Twitter and Instagram hashtag #NeonAt90 and, reportedly, triggering a 137 percent rise in sales of neon clothing and accessories in the UK.

“Her choice was admirable,” Hughes told The Post. “So many mature women are encouraged to dress so they step into the background, but not this very strong woman at the helm of the UK.”

‘What she cannot overtly say with language she secretly says with clothes’

She also abides by a diplomacy factor. Whenever the queen attends an international event such as the Olympics, she will typically wear a color that does not appear in too many flags.

“She wouldn’t want to be perceived as showing favoritism,” said Hughes. “If she went to Russia or China, she would not wear red because she would not want to declare a bias.

“She always thinks about local customs and cultures and any political sensitivities.” That includes at home.

“She would be unlikely to wear red, white and blue together because she would clash with well-wishers waving the Union Flag,” said Hughes. “It would also be too British Airways.”

As a young woman in the 1940s and ’50s, the queen favored conservative British designers such as Norman Hartnell so as not to appear too ­frivolous.

“Elizabeth could not, as her sibling [Princess Margaret] did, be seen to take a private plane to Paris purely in order to try on Christian Dior’s New Look,” writes Hughes.

When Elizabeth wed Philip Mountbatten in 1947, there was still a post-WWII rationing of clothing. Even the queen had to use ration coupons to purchase the material for her bridal gown. Many of her loyal subjects — including heartbroken brides who had lost their fiancés in the war — mailed her their own fabric coupons.

“The queen didn’t feel comfortable accepting the coupons,” said Hughes. “So she sent them all back with a handwritten note to every one.”

These days, most of Elizabeth’s outfits are custom-made by her personal dresser Angela Kelly or royal couturier Stewart Parvin. There’s also her signature transparent Fulton “Birdcage” umbrella — she owns dozens, each with a different colored border, to complement all outfits.

“Every look is meticulously planned,” said Hughes. “Angela Kelly is in charge of spreadsheets logging each item of clothing or accessory. It’s done in such a heavy, detailed way that there are no accidents in what she wears.”

Queen Elizabeth II often wears a single hue to better stand out in a crowd. Check out her rainbow palette: