public static String shorthandHexSingle ( String color ) { validateHexSingle ( color ) ; if ( color . length ( ) > 1 && Character . toUpperCase ( color . charAt ( 0 ) ) == Character . toUpperCase ( color . charAt ( 1 ) ) ) { color = color . substring ( 0 , 1 ) ; } return color ; }
Shorthand the hex single color if possible