It depends on the ship...but I can assure you that I've NEVER seen gun barrels painted silver on any warship...there is a dull silver on the base section of large caliber weapons that have blast bags...these vary in length (the silver) because of the nature of the blast bags to move on the barrels. Early on, the blast bags would be extended, showing little or no silver. After extended firing, the bags would work their way down towards the breech, exposing the unpainted (silver) portion of the barrel.
For USN, WW2 or modern, the predominate camouflage color was carried onto the barrels. In the case of large caliber weapons, there may be two camouflage colors, an upper and lower color. The lower 1/3rd of the barrel is countershaded in white 5-U.
Here's an example:
In all other instances, the ship's camo color is carried over onto the barrels. In the case of smaller, secondary weapons, there's may or may not be countershading. That was left to the discretion of the ship's captain. In the case of 40mm barrels, the outer portion of the barrel is painted, the lower half at the recoil springs is generally black.
Hope these answer your questions.
Jeff