private static String mkString ( TreeSet < Integer > values ) { StringBuilder builder = new StringBuilder ( ) ; builder . append ( "\033[" ) ; // escape. boolean first = true ; for ( int i : values ) { if ( first ) { first = false ; } else { builder . append ( ' ' ) ; } builder . append ( String . format ( "%d" , i ) ) ; } builder . append ( "m" ) ; return builder . toString ( ) ; }
Generate the color string .