protected String ensureTextColorFormat ( String textColor ) { String formatted = "" ; boolean mainColor = true ; for ( String style : textColor . split ( " " ) ) { if ( mainColor ) { // the main color if ( ! style . endsWith ( "-text" ) ) { style += "-text" ; } mainColor = false ; } else { // the shading type if ( ! style . startsWith ( "text-" ) ) { style = " text-" + style ; } } formatted += style ; } return formatted ; }
Allow for the use of text shading and auto formatting .