What causes the pigment in purple potatoes?

Anthocyanin is the pigment that give blue and red potatoes their color. The pigment ranges in color from red to purple to blue.