Shaykh Ibn ‘Uthaymeen was asked about that and he said:
If the hair is dyed black, the Prophet (peace and blessings of Allaah be upon him) forbade that when he commanded a man to change his white hair, but to avoid black. He said: “Change this white hair but avoid black.” (See Saheeh Muslim, 5476). A stern warning has also been narrated to the one who does that, namely the hadeeth of the Prophet (peace and blessings of Allaah be upon him): “There will be people at the end of time who will dye their hair black like the crops of birds; they will not even smell the fragrance of Paradise.” (Narrated by Abu Dawood, 4212; al-Nasaa’i, 8/138; classed as saheeh by al-Albaani in Saheeh al-Jaami’, 8153). This indicates that it is forbidden to change the hair with black dye. With regard to changing it with different colours of dye, the basic principle is that it is permissible, unless it is done in the manner of kaafir women or immoral women, in which case it is forbidden for that reason, because the Prophet (peace and blessings of Allaah be upon him) said: “Whoever imitates a people is one of them.” (Narrated by Abu Dawood, 4031; classed as saheeh by al-Albaani in Irwa’ al-Ghaleel, 5/109).