The color change, driven by hormones, seems aimed at preventing males from accidentally mating with each other.