public static String colorToString ( int col ) { final char [ ] buf = new char [ ] { ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' } ; for ( int i = 6 ; i > 0 ; i -- ) { final int v = ( col & 0xF ) ; buf [ i ] = ( char ) ( ( v < 10 ) ? ( ' ' + v ) : ( ' ' + v - 10 ) ) ; col >>>= 4 ; } return new String ( buf ) ; }
Convert a color name from an integer RGB color to CSS syntax