title: Cannot get Color.HSVToColor to work on Android
body: <p>I've derived a class from <code>View</code> and implemented the <code>onDraw</code> method as follows:</p>
  
  <pre><code>protected void onDraw( Canvas canvas )
  {
      Paint p = new Paint();
      p.setColor( Color.HSVToColor( new float[]{ 1.f, 1.f, 1.f } ) );
      p.setStyle( Paint.Style.FILL );
      canvas.drawRect( area, p );
  }
  </code></pre>
  
  <p>I'm expecting to see an however colored rectangle, but the screen stays white, no metter which values I try for hue, value and saturation. The variable <code>area</code> is a <code>RectF</code>. It's fine, because if I put color to <code>Color.RED</code>, it works.</p>
  
  <p>The Android documentation states on <code>Color.HSVToColor</code>:</p>
  
  <blockquote>
    <p>Convert HSV components to an ARGB color. Alpha set to 0xFF. hsv[0] is Hue [0 .. 360) hsv[1] is Saturation [0...1] hsv[2] is Value [0...1] If hsv values are out of range, they are pinned.</p>
  </blockquote>
  
  <p>I've tried lots of hue/saturation/value combinations, but the screen always remained blank. Furthermore I've tried the following, with same results:</p>
  
  <pre><code>float[] hsv = new float[ 3 ];
  Color.colorToHSV( Color.RED, hsv );
  
  Paint p = new Paint();
  p.setColor( Color.HSVToColor( hsv ) );
  p.setStyle( Paint.Style.FILL );
  canvas.drawRect( area, p );
  </code></pre>
  
  <p>What am I doing wrong?</p>