In the immediate time after capture, the "winning" side puts aboard a "prize crew." This is a junior lieutenant, and a midshipman or two, and some of the senior skilled mates (boatswain, gunner, carpenter, etc.) along with a draft of reliable sailors and a column of Marines. This might only be 30-40 to man a 1st or 2nd rate, and to sail the vessel back to their own waters.
They would not have resources to repaint during that time. They would probably have a National Ensign to fly (they'd keep the captured ones as a trophy). But, under a combat-reduced rig, flying Colors would not be a first priority.
Once "home" the enemy crew was turned over to the authorities--often with only a prison hulk to look forward to. The ship would be given over to a Prize Court. Said Court would then commission a Prize Agent, who would conduct a survey of the vessel.
The Court would set the value of the Prize, and see to the disbursement of the Prize moneys to the appropriate parties. The Surveyor's report would then determine whether the ship was useable in Naval service, or only suitable for salvage.
If taken into naval service, such Commandments and Orders in that Port would then apply. If that included painting, then painting would be done. usually, the budget was spent on replacing the cannon and shot and the like to Fleet standards.
After that, it was down to the whim of the new Captain of the ship, within the rules set by the Squadron Commander or Admiral to which the ship would be assigned.
So, if that Commodore wanted foremasts painted red, then, red they would be. A new captain often had enough to worry about getting a brand new crew used to a brand new ship to worry about whether a given shade of paint had been used.
Even as late as 1805, at Trafalgar, there were no true 'national' standard paint schemes for ships. Nelson had instituted Squadron and Fleet rules, to help unify the appearance of the RN ships. The combined French and Spanish squadrons were in every color scheme imaginable. Including all-black, and all red.