public static int getColorType ( String value ) { if ( value != null && value . startsWith ( "#" ) ) { switch ( value . length ( ) ) { case 4 : return TypedValue . TYPE_INT_COLOR_RGB4 ; case 5 : return TypedValue . TYPE_INT_COLOR_ARGB4 ; case 7 : return TypedValue . TYPE_INT_COLOR_RGB8 ; case 9 : return TypedValue . TYPE_INT_COLOR_ARGB8 ; } } return TypedValue . TYPE_INT_COLOR_ARGB8 ; }
Returns the TypedValue color type represented by the given string value