public TextCharacter withForegroundColor ( TextColor foregroundColor ) { if ( this . foregroundColor == foregroundColor || this . foregroundColor . equals ( foregroundColor ) ) { return this ; } return new TextCharacter ( character , foregroundColor , backgroundColor , modifiers ) ; }
Returns a copy of this TextCharacter with a specified foreground color