Different bacteria can produce pigments of different colors. What is the purpose for bacteria doing so? Does it happen just by chance? One thing I know is that some pigments have antibiotic activity that help producers against other bacteria. But I don't think color matters in the antibiotic activity of producers?