title: Change background colour dynamically
body: <p>I am using RangeSeekBar to set some values for 3 conditions (i.e. Green=OK,Amber=Warning, Red=evacuate)... I am using xml drawable to set the backgroung like this</p>
  
  <pre><code>&lt;shape xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;gradient 
          android:startColor="#27F70C" 
          android:centerColor="#FFBF00"
          android:endColor="#FC0505" 
          android:angle="0" /&gt;
  
      &lt;corners android:radius="0px" /&gt;
  
      &lt;stroke 
          android:width="2dp" 
          android:color="#70555555" /&gt;
  
      &lt;stroke 
              android:width="0dp" 
              android:color="#70555555" /&gt;
  &lt;/shape&gt;
  </code></pre>
  
  <p>which results like this
  <img src="https://i.stack.imgur.com/wFqOq.png" alt="enter image description here"></p>
  
  <p>Now I want to change the background colour according to the seekbar values so that If I change the range it should change the background colour something like this
  <img src="https://i.stack.imgur.com/tGSti.png" alt="enter image description here"></p>
  
  <p>I know I can change the gradient programmatically but how to narrow down start color and increase end colour ?
  Anyone has a solution for this ?</p>
  
  <p>Thanks</p>