package org.robolectric.shadows;

import android.graphics.Color;
import org.robolectric.bytecode.RobolectricInternals;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;

import static org.fest.reflect.core.Reflection.method;

@Implements(Color.class)
public class ShadowColor {
  @Implementation
  public static int rgb(int red, int green, int blue) {
    return argb(0xff, red, green, blue);
  }

  @Implementation
  public static int argb(int alpha, int red, int green, int blue) {
    return (alpha << 24) | (red << 16) | (green << 8) | blue;
  }

  @Implementation
  public static int parseColor(String colorString) {
    if (colorString.charAt(0) == '#' && colorString.length() == 4 || colorString.length() == 5) {
      StringBuilder buf = new StringBuilder();
      buf.append('#');
      for (int i = 1; i < colorString.length(); i++) {
        buf.append(colorString.charAt(i));
        buf.append(colorString.charAt(i));
      }
      colorString = buf.toString();
    }
    try {
      return method(RobolectricInternals.directMethodName(Color.class.getName(), "parseColor"))
          .withReturnType(int.class)
          .withParameterTypes(String.class)
          .in(Color.class)
          .invoke(colorString);
    } catch (Exception e) {
      throw new IllegalArgumentException("Can't parse value from color \"" + colorString + "\"", e);
    }
  }
}
@@ -320,280 +320,8 @@
 or %7B
-%0A  @Implementation%0A  public static int rgb(int red, int green, int blue) %7B%0A    return argb(0xff, red, green, blue);%0A  %7D%0A%0A  @Implementation%0A  public static int argb(int alpha, int red, int green, int blue) %7B%0A    return (alpha %3C%3C 24) %7C (red %3C%3C 16) %7C (green %3C%3C 8) %7C blue;%0A  %7D
 %0A%0A  
@@ -1134,8 +1134,9 @@
  %7D%0A  %7D%0A%7D
+%0A

Remove some shadows methods in Color.