Purple garlic color change
The purple is just the anthocyanins in the garlic reacting to conditions. It's perfectly safe. Some types of garlic actually turn purple before they are picked if they are fertilized close to maturity; I do this now by choice, because I've decided I like the purple. The purple will occur more frequently and to a greater degree if the garlic is cooked with or peeled cloves are stored in contact with something acidic.