Purple (or other) color is a heritable trait of cannabis.
A plant's maximum intensity of purple is genetically set.
You can ENCOURAGE a plant to become as purple as its genes allow by dropping the temperature into the low 60s close to harvest. The green chlorophyll breaks down, exposing the other pigments produced byt the plant.
There is also a product called PurpleMAxx that is intended to intensify the color of your herb. It is NOT a dye; you cannot simply add purple food coloring to your plant to make it go colors.
If a plant is genetically incapable of producing any other color other than green, you can't do a thing about it.