public TextCharacter withoutModifier ( SGR modifier ) { if ( ! modifiers . contains ( modifier ) ) { return this ; } EnumSet < SGR > newSet = EnumSet . copyOf ( this . modifiers ) ; newSet . remove ( modifier ) ; return new TextCharacter ( character , foregroundColor , backgroundColor , newSet ) ; }
Returns a copy of this TextCharacter with an SGR modifier removed . All of the currently active SGR codes will be carried over to the copy except for the one specified . If the current TextCharacter doesn t have the SGR specified it will return itself .