You can use a can of WD40 on a light color hat. You can also take and put some tea in a spray bottle.
These are what I've heard guys use with some success. I've never tried doing it, instead bought one already done. But I've heardthat some companies"wash' out after a while.
On a black one use salt water mix.
Rick
Ps
Once you use tea or Rit dye you are stuck with it