public double getColorPercentage ( Color color ) { if ( color == null ) return 0 ; else { Integer num = colors . get ( colorKey ( color ) ) ; if ( num == null ) num = 0 ; if ( totalLength == 0 ) return 0 ; else return ( double ) num / totalLength ; } }
Obtains the percentage of the text that has the given color .