title: What is the algorithm to create colors for a heatmap?
body: <p>Assuming values are normalized from 0 to 1, what is the algoritm to get a color to create a heatmap like this?</p>
  
  <p>1 is red, .5 is green, 0 is dark blue.</p>
  
  <p>Working in RMagick / ImageMagick.</p>
  
  <p><img src="https://i.stack.imgur.com/ZwJC2.jpg" alt="heatmap"></p>