Hue to lightness swap

hi all,
i’m trying to convert a greyscale texture in a sort of “heat map”, and viceversa. What i mean is that i need to take the lightness of a texture and use it for change the hue.
i tried wih pipet, and it work, but the problem is that pipet is vvvery resource eater, and i think if there is a shader for doing the same thing it should be much faster.
i attach a patch to exaplain what i want to do. In the patch theres only the greyscale to color, but really i need to have the color to greyscale (so hue to lightness) too.
anyone have some ideas? i found this that could be a good start, but i’m really noob in shader programming

thx all ;)

grey_to_color.v4p (9.7 kB)

somwhere i had a colorspace converter shader, you can use it:

GrayToHSV.zip (48.2 kB)

thx tonfilm, exactly what i need :DDD

This will do it too
http://vvvv.org/tiki-download_file.php?fileId=1986