Is dying my hair at 39 weeks safe?

Is dying my hair at 39 weeks safe?