title: android: Animate color change from color to color
body: <p>Assuming I have two colors, and I need to create a real time animation that fastly switches from a color to another.</p>
  
  <p>I tried just to increment the color hexadecimal until I reach the other, but that gave a really bad animation as it showed lots of unrelated colors.</p>
  
  <p>I am using <code>setColorFilter(color, colorfilter)</code> to change the color of an imageview.</p>
  
  <p>Changing the HUE will give me the best visual results? If so, how can I change it for a solid color?</p>
  
  <p>SOLUTION:
  I solved it by recursively shifting hue</p>
  
  <pre><code>private int hueChange(int c,int deg){
         float[] hsv = new float[3];       //array to store HSV values
         Color.colorToHSV(c,hsv); //get original HSV values of pixel
         hsv[0]=hsv[0]+deg;                //add the shift to the HUE of HSV array
         hsv[0]=hsv[0]%360;                //confines hue to values:[0,360]
         return Color.HSVToColor(Color.alpha(c),hsv);
      }
  </code></pre>