It may be of interest to you to know that modern submarines are not painted at all. Instead, all the present-day submarines are covered with anechoic tiles which improve their stealth characteristics.
Anechoic tiles are rubber or synthetic polymer tiles containing thousands of tiny holes, applied to the outer hulls of military ships and submarines.
Their function is two fold:
First. To absorb the sound waves of active sonar used by the enemy.
and The Second is to attenuate the sounds emitted from inside the submarine – mainly the engine room noise – to avoid detection.
it began at world war I, when the U.S. Navy found that their submarines were easily spotted by enemy aircraft when they surfaced for refueling.so, the scientists conducted various experiments, and eventually decided upon a light-grey paint for the body and black paint for the deck.
so, by the time world war II began, they had repainted the decks of most of their subs dark blue instead of black as this colour offered the best camouflage in shallow waters. However, they found out that the blue paint deteriorated and the colour faded fast, and so now the original black colour is chosen for its durability.