Search the web on
pseudocoloring[
^] Pseudocolor is derived from a grayscale image by mapping each intensity value to a color according to a table or function.
You should create a mapping that will connect your grayscale intensity (say 0 to 255 for 8 bit per pixel) to a spectrum color intensity (from a scale of your choosing; a very crude example could be 0-75 are tones of blue, 76-150 are tones of green, 151-225 are tones of red, 226-255 are tones of yellow. You can define these colors in RGB, but I believe HSV or HSL color spaces are easier, if you have knowledge of them.). Then you will apply this mapping to your grayscale image pixel by pixel (using two for loops in one another, for example).
A C++ example could be found
here[
^].
There is a c# example for emgu CV
here[
^].