Ladies who dye their own hair at home

Do you dye your hair when it’s freshly washed and clean, or do you dye your hair if it’s greasy or hasn’t been washed for a couple days?