Blue, definitely blue. There’s a history of the British Naval uniforms at the British National Maritime Museum Web site. The second page lists changes in 1795 – mostly about the application of gold lace to officers’ blue coats. Starting on the fourth page, they list the components of different officers’ uniforms. They all feature blue coats, with varying colors of breeches and waistcoats (usually white, though breeches could sometimes be blue).
You can also view extant uniforms through their online collections. Naval uniform coats are all blue, and there are a couple red Marine coats thrown into the mix, as well.
The movie “Master & Commander” was heavily researched by the way, and past discussion of it on the boards has revealed that the only quibble most history buffs have with it is that the uniforms were too up-to-date; that is, officers on a ship during wartime would have uniforms that were several years out of date compared to the ones back home.
ETA: I forgot to mention/emphasize that if you see a guy in a red coat on an 18th-century ship in the British navy (as one does), the guy is a Marine. I’m not too sure on the differences between naval uniforms and marine uniforms, as apparently Marines could sometimes wear blue coats, too. I guess being a Marine isn’t as exciting as being a naval captain – the uniforms aren’t as shiny.