Android's RGBToHSV method doesn't work
<p>According to <a href="http://developer.android.com/reference/android/graphics/Color.html#RGBToHSV%28int,%20int,%20int,%20float%5b%5d%29" rel="nofollow">the document</a>, android.graphics.Color has a method called <code>RGBToHSV</code> which can convert RGB values to HSV, this is what the document tells me:</p>

<pre><code>public static void RGBToHSV (int red, int green, int blue, float[] hsv)
</code></pre>

<blockquote>
  <h3>Convert RGB components to HSV.</h3>
  
  <ul>
  <li><code>hsv[0]</code> is Hue [0 .. 360)</li>
  <li><code>hsv[1]</code> is Saturation [0...1]    </li>
  <li><code>hsv[2]</code> is Value [0...1]</li>
  </ul>
  
  <h3>Parameters</h3>
  
  <ul>
  <li><em>red</em>:  red component value [0..255]</li>
  <li><em>green</em>:    green component value [0..255]</li>
  <li><em>blue</em>: blue component value [0..255]</li>
  <li><em>hsv</em>:  3 element array which holds the resulting HSV components.</li>
  </ul>
</blockquote>

<p>But when I write a program to test it, it doesn't work any way.</p>

<pre><code>float[] hsv = new float[3];

RGBToHSV(255, 255, 0, hsv);

Log.i("HSV_H", "" + hsv[0]);   // always output 0.0
</code></pre>

<p>Is it a bug ? </p>
