Avoiding contact with spray paint is the best prevention. If you need to be around spray paint, it is recommended to cover your hair with a scarf, hat, or shower cap. Additionally, applying a barrier cream, such as petroleum jelly, to your hairline can provide some protection against stains.