Color change almost always means something in the formula is oxidizing or reacting. The usual suspects are fragrance (vanillin in particular browns over time), botanical extracts, oils, vitamin C, and trace metals — sped up by light, heat and air. The fastest way to find the cause is to make small batches with one suspect ingredient left out at a time.