What determines the colors and patterns of a clam shell?
This post is pretty well written and seems to say that the evolutionary forces that produce shell color like this is not known.  There are suggestions that the color is camoflage or the result of metabolic byproducts or that the pigments serve to strengthen the shell.  Its hard to believe some of these theories given that some shells do fine without coloring (at least that humans can see).  

Structurally, shells are living things.  [They consist of many layers of thin irregular calcium carbonate hexagonal plates that make the mineral portion of the shell. The plates are held together by a protein glue and renewed by cellular action][3].  Whatever their evolutionary motivations, the colors are biomolecules which are in the biomatrix binding the plates together. This is a reason that shells that are left out to dry in the sun can become bleached and brittle. 

I wish I had some better references about the shell structure, but I'm remembering a lot of this from a one afternoon book report given in a class, not from any intensive study on my part. 

This has influenced some ideas about things like tank armor, by the way.  At least there is funding for biomaterials research by agencies interested in tank armor.  Lamellar armor made of segmented plates can withstand tremendous impacts at a single point like a shell being dropped from a great height by a seabird or a shell hitting a tank. Plates just a few microns wide and a fraction of a micron deep shaped like irregular hexagons are hard to make if you aren't a mollusc so far though.