public static int rgb(String hex){
  int color=(int)Long.parseLong(hex.replace("#",""),16);
  int r=(color >> 16) & 0xFF;
  int g=(color >> 8) & 0xFF;
  int b=(color >> 0) & 0xFF;
  return Color.rgb(r,g,b);
}

public static int rgb ( String hex ) { int color = ( int ) Long . parseLong ( hex . replace ( "#" , "" ) , 16 ) ; int r = ( color > > 16 ) & 0xFF ; int g = ( color > > 8 ) & 0xFF ; int b = ( color > > 0 ) & 0xFF ; return Color . rgb ( r , g , b ) ; }
converts the given hex - color - string to rgb .
