Getting hair dye out of carpet is tough - and if you're to have much luck it's best if you can get at the stain immediately. Here's what to do:
Blot the stain immediately with a clean, white cloth.
Mix a solution of 1/4 tsp. liquid hand-dishwashing soap and 1 cup lukewarm water.
Blot stain with soap solution, using a clean, white cloth. Blot from the outside of the stain, working inward.
Let sit a few minutes.
Mix a solution of 1 part vinegar to 2 parts lukewarm water.
Dab stain with vinegar solution, again working from the outside in.
Once the stain has disappeared, flush the area with cold water and blot dry with a clean, white cloth.
If you don't have success with these methods, you will have to call in a professional carpet cleaner.