Two things may be at play here: mushroom spores or mold. If your mushrooms' veils break, you will often notice a layer of black around the surrounding area. This is normal -- your mushroom simply reached maturity and was ready to reproduce, as if it were in nature. If the black is not as widespread, but rather focused on one specific part of your cake then it may be mold. Any other type of coloration outside the normal spore dispersal or blue staining should be treated as contamination.