You might assume that such a change in color indicates that your garlic has gone bad, but that's not the case. The color has no effect on its safety or flavor.
So there’s a good chance of garlic turning blue when cooked with acidic ingredients. Cool temperatures, like that of a refrigerator, can also cause garlic to turn blue.