Necessity truly is the mother of invention.

A quick-thinking woman at a racetrack in England created a fashionable new style for herself — on the fly — after spilling wine all over her white outfit.

PHOTOS: MOM, 64, CLAIMS PEOPLE MISTAKE HER AND DAUGHTER FOR SISTERS

Eleanor Walton, 19, was at the Ripton Races track in North Yorkshire, England, when a stranger accidentally bumped into her, causing her to spill red wine all over her jumpsuit.

Walton, 19, was at the Ripton Races track in North Yorkshire, England, when a stranger accidentally bumped into her, causing her to spill red wine all over her jumpsuit.

Walton, 19, was at the Ripton Races track in North Yorkshire, England, when a stranger accidentally bumped into her, causing her to spill red wine all over her jumpsuit. (SWNS)

But instead of calling it a day, or even accepting that she would now have to sport a stained PrettyLittleThing jumpsuit for the remainder of the races, Walton and her friend Mia Williamson, 18, came up with another idea entirely: Dye the rest of her outfit pink to match.

FOLLOW US ON FACEBOOK FOR MORE FOX LIFESTYLE NEWS

"It was a free bar so I said to Eleanor, “Let's go and get as much red wine as we can and we'll sort it out in the toilet,’” said Williamson, according to SWNS.

Walton and her friend Mia Williamson (left) decided to incorporate the spilled wine into a stylish new look.

Walton and her friend Mia Williamson (left) decided to incorporate the spilled wine into a stylish new look. (SWNS)

CLICK HERE TO SIGN UP FOR OUR LIFESTYLE NEWSLETTER

The two then took off for the bathroom, where Walton and Williamson filled the sink with the wine and submerged parts of the jumpsuit in it.

"We got in there and she stripped off in the cubicle while I found a plug for the sink,” Williamson said. "I just poured all the wine in one go and hoped for the best."

They then held Walton’s jumpsuit under a hand dryer to dry, before she threw it back on. The result, to their surprise, was a “magical, glorious pattern.”

"Quite a few people" ended up giving Walton compliments on the new look, according to her friend.

"Quite a few people" ended up giving Walton compliments on the new look, according to her friend. (iStock)

In photos shared by Walton and Williamson, Walton can be seen modeling the new, freshly dyed jumpsuit in the Ripton Races bathroom, and it’s hard to tell she didn’t buy it that way.

Other folks at the track seemed to agree, too.

CLICK HERE TO GET THE FOX NEWS APP

"Quite a few people were complimenting her on the outfit afterwards,” Williamson said. "It looks like a unique piece."