diff --git a/graphics/java/android/graphics/Color.java b/graphics/java/android/graphics/Color.java
index 666dbd8..23d26eb 100644
--- a/graphics/java/android/graphics/Color.java
+++ b/graphics/java/android/graphics/Color.java
@@ -236,89 +236,6 @@
     }
 
     /**
-     * Convert HSB components to an ARGB color. Alpha set to 0xFF.
-     *     hsv[0] is Hue [0 .. 1)
-     *     hsv[1] is Saturation [0...1]
-     *     hsv[2] is Value [0...1]
-     * If hsv values are out of range, they are pinned.
-     * @param hsb  3 element array which holds the input HSB components.
-     * @return the resulting argb color
-     * 
-     * @hide Pending API council
-     */
-    @ColorInt
-    public static int HSBtoColor(@Size(3) float[] hsb) {
-        return HSBtoColor(hsb[0], hsb[1], hsb[2]);
-    }
-    
-    /**
-     * Convert HSB components to an ARGB color. Alpha set to 0xFF.
-     *     hsv[0] is Hue [0 .. 1)
-     *     hsv[1] is Saturation [0...1]
-     *     hsv[2] is Value [0...1]
-     * If hsv values are out of range, they are pinned.
-     * @param h Hue component
-     * @param s Saturation component
-     * @param b Brightness component
-     * @return the resulting argb color
-     * 
-     * @hide Pending API council
-     */
-    @ColorInt
-    public static int HSBtoColor(float h, float s, float b) {
-        h = MathUtils.constrain(h, 0.0f, 1.0f);
-        s = MathUtils.constrain(s, 0.0f, 1.0f);
-        b = MathUtils.constrain(b, 0.0f, 1.0f);
-        
-        float red = 0.0f;
-        float green = 0.0f;
-        float blue = 0.0f;
-        
-        final float hf = (h - (int) h) * 6.0f;
-        final int ihf = (int) hf;
-        final float f = hf - ihf;
-        final float pv = b * (1.0f - s);
-        final float qv = b * (1.0f - s * f);
-        final float tv = b * (1.0f - s * (1.0f - f));
-
-        switch (ihf) {
-            case 0:         // Red is the dominant color
-                red = b;
-                green = tv;
-                blue = pv;
-                break;
-            case 1:         // Green is the dominant color
-                red = qv;
-                green = b;
-                blue = pv;
-                break;
-            case 2:
-                red = pv;
-                green = b;
-                blue = tv;
-                break;
-            case 3:         // Blue is the dominant color
-                red = pv;
-                green = qv;
-                blue = b;
-                break;
-            case 4:
-                red = tv;
-                green = pv;
-                blue = b;
-                break;
-            case 5:         // Red is the dominant color
-                red = b;
-                green = pv;
-                blue = qv;
-                break;
-        }
-
-        return 0xFF000000 | (((int) (red * 255.0f)) << 16) |
-                (((int) (green * 255.0f)) << 8) | ((int) (blue * 255.0f));
-    }
-
-    /**
      * Convert RGB components to HSV.
      *     hsv[0] is Hue [0 .. 360)
      *     hsv[1] is Saturation [0...1]
