According to the geneticist Greger Larson of Durham University  in the UK and Leif Andersson of Uppsala University in Sweden, pigs developed their bright coat colors after domestication.

Although the process of pig domestication began 10.000 years ago, many variable traits such as bright coat colour found in domestic animals are the result of relatively recent human-mediated selection  thaks to the human perchant for novelty.  Early farmers selected and bred the brightly colored pigs to distinguish them for their brown and black wild relatives. The gene analysis shows that wild pigs and boars today are evolving through natural selection to maintain  camouflage colours to escape detection by predators in the forest.

The study of Larson and Andersson addresses why coat colors of domestic animals are so variable, while those of their wild ancestors are so uniform.  They investigated genetic variation in the melanocortin receptor 1 (MC1R) gene -a protein regulating mammalian skin and hair color- among wild and domestic pigs from both Europe and Asia. Though we found a similar number of mutations in wild and domestic pigs, the nature of the mutations was strikingly different. All mutations found among wild boars were silent, i.e., they did not change the protein sequence. This implies strong purifying selection in the wild that maintains camouflage coat color. In contrast, nine out of ten mutations found in domestic pigs altered the protein sequence, thereby drastically transforming the resulting coat color. These results demonstrate that early farmers intentionally selected pigs with novel coat coloring. Their motivations could have been as simple as a preference for the exotic or selection for reduced camouflage to facilitate animal husbandry and/or to make the domesticated forms distinct from their wild ancestor.

These mutations account for pigs that are black, or pink, or spotted, all colors and patterns that would have a hard time surviving in the wild. Interestingly, a pink pig doesn’t produce any melanin, making pink a “default” color.