title: Color Range Python
body: <p>I want to know how I can get a color depending on a value between [0-100] where 0 is red and 1 is green and I want values between them to be interpolated colors between red and green (orange, yellow...,..). I'm using python in Blender 3D. The below lines of code can generate rainbow colors as shown <a href="http://python3.codes/fractal-tree/" rel="noreferrer">here</a> but I wonder how I can set it to only between red, yellow and green and also how to control my range of colors (0-100)</p>
  
  <pre><code>import colorsys
  (r, g, b) = colorsys.hsv_to_rgb(float(depth) / maxd, 1.0, 1.0)
  R, G, B = int(255 * r), int(255 * g), int(255 * b)
  </code></pre>