This also happened to me.
In my Freegan foragings I found a large quantity of reasonably fresh garlic.
Having no refrigerator or freezer at the time I decided to pickle the blanched and peeled cloves to preserve them for later use.
They turned a number of shades of blue, from turquoise to purple.
I attributed this to a chemical reaction between the acetic acid (vinegar) and organic compounds in the garlic behaving in a manner similar to an indicator (of acidity - like litmus).
I didn't bother to identify the compounds.
The garlic's new colour made it unappetising so I had to re-disposed of it.