
And so, in the following tutorial, I shall describe how to make rainbows and other gradients on an avatar edit. This technique applies not only to hair but to any part of an edit you like.
Let's use this one as an example:

What do we do if we want that pink dress to be a rainbow instead of pink? First, we desaturate the dress to make all the pink gray:

Then, select the layer the gray parts of the dress are on by ctrl+clicking the dress layer in the Layers palette. You should see that the dress is selected. Make a new layer below the dress layer, and hide the dress layer. On your new layer, make your gradient:

Looks pretty horrid, right? Easily fixed. Re-activate the gray dress layer and change its mode from Normal to Linear Light:

The shading now shows up on the gradient, but it's a smidge bright. Use the Brightness/Contrast tool in the Image>Adjustments menu on the gray shading layer until it looks the way you want it to.

Easy! You don't have to do rainbows, either - this works with any gradient:



You can even use a colorful Pattern instead of a gradient:


Go nuts!