If Morris Day had his way, the star of “Purple Rain” would have been Prince’s black eye.

As The Time frontman, who was Prince’s on-screen and off-screen rival, reveals in his new book “On Time: A Princely Life in Funk” (Da Capo), out now, tensions on the set of the 1984 movie had reached a boiling point thanks to the star’s power trips, Day’s cocaine use and a stressful shooting schedule.

One morning, Day turned up late and Prince exploded, shoving him. Day prepared to throw a punch — only the intervention of Prince’s bodyguard and The Time drummer Jellybean Johnson stopped them from trading blows.

“Of course it would have went my way,” Day told The Post with a laugh. “I outweighed the dude by a good 25 pounds!”

The movie — fueled by Prince’s untouchable music and Day’s charisma — went on to clean up at the box office, grossing $70 million and making them both stars.

But Day lived in a shadow. His group, The Time, had been assembled by Prince and was controlled by Prince, who co-wrote their songs, including “Jungle Love” and “The Bird,” under the pseudonym Jamie Starr.

The book, co-written with David Ritz, is presented as a conversation between Day and Prince, and outlines the often tense friendship between the two, who met as teenagers in Minneapolis in the mid-1970s.

Day was the drummer for Prince’s first band, Grand Central, and stuck around after his pal went solo: acting as tour videographer and fronting The Time, a group that Prince created because he wrote more songs than he could possibly release on his own.

But a competition heated up almost immediately. “I wanted to scare him,” writes Day. “Wanted him . . . to think twice about how to outfunk us.”

Not only did The Time give Prince a run for his money on stage as his tour opener, “there was even competition when it came to partying,” Day writes. While Prince’s hotel-room bashes were “strictly suburban,” Day’s were all about “drinking. Smoking. Coking. Couples moaning and boning.”

One night, Day writes, Prince dropped by The Time party to see what was going on. But when “no one gave a s–t that he was there — Prince got pissed and left.”

On the last show of the “Controversy” tour, Prince’s band threw rotten garbage while The Time performed. From there, “s–t got violent . . . punches thrown and a couple of hotel rooms wrecked,” Day writes.

On a later tour, Prince insisted The Time play as the backing band for his newest protege, Vanity 6 — but made them stand behind a closed curtain.

When it came to making “Purple Rain,” Day recalled, his old friend Prince was in “macho mode. I was there when he was [previously] . . . called out for being effeminate, and I know the humiliation remained in his mind.” So Prince created a character that dressed in black leather, rode astride a big Harley and seduced a hot babe, played by Apollonia.

“It’s a triumph,” Day writes of the performance. “But also overcompensation for his earlier image of sexual ambiguity.”

The movie hit big, and during the summer of 1984, Prince held the nation’s No. 1 film, album and single (“When Doves Cry”) all at once.

“After ‘Purple Rain,’ everyone’s career took off. [But] there was definitely stuff that made me think he had a Jesus or a God complex,” said Day. “I think if he had his way, he would have [had] a Paisley Park compound, with my house, Vanity’s house, and [percussionist] Sheila E.’s house, that he personally bought and that he could kick you out of if he wanted.”

Prince and Day’s relationship would continue to go through peaks and valleys. They reconnected for 1990s “Purple Rain” sequel “Graffiti Bridge,” but Day had to fight tooth and nail to distance his solo albums from his Svengali’s influence.

One of the last times they played together was when Prince invited The Time to perform at Paisley Park for a New Year’s Eve party in 1999. By then, Prince had turned his back on his hyper-sexual image and become a Jehovah’s Witness.

The singer summoned The Time to a studio to preach his new religion to the captive band members. The “arrogant” sermon was so long, it required a bathroom break in the middle.

“The same guy that was telling everyone to get naked and have wild sex was the same guy who later was telling women at his Paisley Park parties that they were dressed improperly,” said Day.

He last saw Prince at another private Paisley Park show, just three months before the legend’s death in April 2016 at age 57.

“When he passed away, I almost didn’t have feelings,” says Day, now 61.

“Then something woke me up in the night, about midnight, and I thought, ‘Hold on, I have history with this guy.’ Then the floodgates opened, and I started to feel. We learned how to be funky together, so musically, there’s just no way that boy will ever go anywhere!”