title: Python: convert values between 0 and 1 to color range red to blue
body: <p>I know this is very similar to a <a href="https://stackoverflow.com/questions/10901085/python-range-values-to-pseudocolor">previous question</a> that I had posted, I cannot figure out how to modify it to suit this problem.</p>
  
  <p>I have a array of values between 0 and 1. I want to convert these values to RGB color array ranging from red (0) to blue (1). The solution suggested in the previous question converted values to HSV tuples first, and then used <code>colosys.hsv_to_rgb()</code> to convert to RGB values.</p>
  
  <p>This was fine if I wanted to generate colors between red and green. I could interpolate the hue value linearly. However, when the extreme colors are red and blue, the intermediary values take on green color because green hue lies between red and blue. Is there a way I can avoid this and get colors only in the vicinity of red and blue?</p>
  
  <p>I know I can linearly interpolate RGB values directly, but that does not give a good color spectrum. So please tell me a solution using HSV space.</p>