title: How to generate numbers within a range in a non random way with JavaScript?
body: <p>I know how to generate a random number between two numbers. But what I'd like to achieve is a way to generate a number between two numbers in a not totally random way. Let me explain...</p>
  
  <p>So I have a function that generates a color based on a number passed into it. If that number is between 0 and 600, I'd like it to pass a number between 0 and 120 to the hue of the hsl value. If the number is greater than 600, I'd like a number between 120 and 240 passed to the hue of the hsl value. My function looks something like this:</p>
  
  <pre><code>getColor:function (number {
    var hue;
    var color;
    if (number &lt;= 600) {
      hue = [A number between 0 and 120];
    } else if (number &gt;= 600) {
      hue = [A number between 120 and 240];
    }
    color = 'hsl(' + hue + ', 100%, 80%)'
    return color;
   }
  </code></pre>
  
  <p>So the higher the number passed into the function, for example, between 0 and 600, the higher the hue value between 0 and 120. That make sense?</p>
  
  <p>Thx u
  -- Gaweyne</p>