It changes its color due to the chemical reaction that takes place between amino acid and acetic acid. Therefore, when you put the garlic in your vinegar-based pickles, it tends to change its color to green or blue.