public Color toAWTColor ( TextColor color , boolean isForeground , boolean inBoldContext ) { if ( color instanceof TextColor . ANSI ) { return colorPalette . get ( ( TextColor . ANSI ) color , isForeground , inBoldContext && useBrightColorsOnBold ) ; } return color . toColor ( ) ; }
Given a TextColor and a hint as to if the color is to be used as foreground or not and if we currently have bold text enabled or not it returns the closest AWT color that matches this .