title: Get the ranges and color associated with it - Chroma.js
body: <p>I've a certain requirement where in user will input the color and the values.</p>
  
  <p>I'm using <a href="http://gka.github.io/chroma.js/" rel="nofollow">chroma.js</a>, say for example</p>
  
  <pre><code>var scale = chroma.scale(['color1','color2','color3']).domain([0,3,10,80,100]);
  </code></pre>
  
  <p>So now I've 3 user defined color and muliple values.  I'm using the chroma.js to get the color out of it for the particular value.</p>
  
  <pre><code>scale(10).hex() // Will give me a #color
  </code></pre>
  
  <p>My Question is,  I need something like</p>
  
  <pre><code>0 - 30 = color1
  30 - 65 = color2
  65 - 100 = color3
  </code></pre>
  
  <p>Please help me how to achieve this using chroma.js.  Hope my question is clear.</p>