Bismihi ta'ala
It is our Shi'i culture that in the two months of Muharram and Safar we do not engage in celebration or any form of public happiness, or adorning ourselves with zeenah, makeup, and so on.
If one was to dye their hair (as zeenah) in desecrating the sanctity of Ahlul Bayt (a.s.), then it would certainly be haram.
However, for the sake of getting rid of white hair, and not for zeenah, it would not be considered haram, but best not to, especially if the common custom ('urf) sees it as something wrong. As the hadith expresses, we show happiness when Ahlul Bayt are happy, and we show grief when Ahlul Bayt are sad.
And Allah knows best.