public static int parseColor(String colorString){
  if (TextUtils.isEmpty(colorString)) {
    return TRANSPARENT;
  }
  if (colorString.charAt(0) == '#') {
    if (colorString.length() == 7 || colorString.length() == 9) {
      long color=Long.parseLong(colorString.substring(1),16);
      if (colorString.length() == 7) {
        color|=0x00000000ff000000;
      }
      return (int)color;
    }
 else {
      return TRANSPARENT;
    }
  }
 else {
    Integer color=colorNameMap.get(formatKey(colorString));
    if (color != null) {
      return color;
    }
  }
  return TRANSPARENT;
}

public static int parseColor ( String colorString ) { if ( TextUtils . isEmpty ( colorString ) ) { return TRANSPARENT ; } if ( colorString . charAt ( 0 ) == '#' ) { if ( colorString . length ( ) == 7 || colorString . length ( ) == 9 ) { long color = Long . parseLong ( colorString . substring ( 1 ) , 16 ) ; if ( colorString . length ( ) == 7 ) { color |= 0x00000000ff000000 ; } return ( int ) color ; } else { return TRANSPARENT ; } } else { Integer color = colorNameMap . get ( formatKey ( colorString ) ) ; if ( color != null ) { return color ; } } return TRANSPARENT ; }
determine the rgb value of a named color , or a string formatted as " # aarrggbb " . returns a transparent color if the color can ' t be determined from the string .
