It's not strictly a vitamin that controls the fruit colour but many purple fruits are high in malic acid which is often treated as a vitamin despite not having a letter. It's most closely linked to vitamin C.
Generally purple fruit colour contain nutrients which include lutein, zeaxanthin, resveratrol, vitamin C, fiber, flavonoids, ellagic acid, and quercetin. But it is not necessary.