Mostly it is thought that the dye absorbed by the scalp may break the fast. Fasting (sawm) is abstention from eating, drinking and sexual relations from fajr time to maghrib time. Drips or injections including nutritives also break the fast because they let nutrients and water directly into the blood.
The dye absorbed by the scalp is neither nutrition, nor it is drank nor eaten. Dying -colouring- hair therefore does not fall under any of these categories and does not break the fast.