Can I dye my hair with hairspray on

Or do I have to wash it out Update, washed it out and it's perfect