title: Map a value [0.0-1.0] to color gain
body: <p>I need to translate values from 0.0 to 1.0 to their color representations (each value is a pixel). I am making a spectrogram, so the higher the value the brightest the pixel should be (as in the below image).</p>
  
  <p>How can I do this? I am working in C# but a universally applicable solution is fine too.</p>
  
  <p>Example:</p>
  
  <p><img src="https://i.stack.imgur.com/tYGtG.png" alt="enter image description here"></p>