|
|
|
@ -227,6 +227,13 @@ class ColorTerminalOutput(SaveAttrOutput):
|
|
|
|
|
mapBackgroundColors = ConsoleCodeMapping(ConsoleCodesInfo.BACKGROUND,
|
|
|
|
|
BaseColorMapping)
|
|
|
|
|
|
|
|
|
|
def __init__(self, state=None, escSymb=None):
|
|
|
|
|
SaveAttrOutput.__init__(self, state=state)
|
|
|
|
|
if escSymb is None:
|
|
|
|
|
self.escSymb = '\033'
|
|
|
|
|
else:
|
|
|
|
|
self.escSymb = escSymb
|
|
|
|
|
|
|
|
|
|
def setBold(self):
|
|
|
|
|
self.resetHalfbright()
|
|
|
|
|
super(ColorTerminalOutput, self).setBold()
|
|
|
|
@ -319,7 +326,7 @@ class ColorTerminalOutput(SaveAttrOutput):
|
|
|
|
|
"""
|
|
|
|
|
Создать ESC строку
|
|
|
|
|
"""
|
|
|
|
|
attrs = map(str, ['\033['] + attrs + ['m'])
|
|
|
|
|
attrs = map(str, ['%s[' % self.escSymb] + attrs + ['m'])
|
|
|
|
|
return "%s%s%s" % (attrs[0], ";".join(attrs[1:-1]), attrs[-1])
|
|
|
|
|
|
|
|
|
|
def outputText(self, s):
|
|
|
|
@ -392,8 +399,8 @@ class ColorTerminal16Output(ColorTerminalOutput):
|
|
|
|
|
После преобразования текст и фон могут одинакового цвета
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def __init__(self, state=None, palette=None):
|
|
|
|
|
SaveAttrOutput.__init__(self, state=state)
|
|
|
|
|
def __init__(self, state=None, palette=None, escSymb=None):
|
|
|
|
|
ColorTerminalOutput.__init__(self, state=state, escSymb=escSymb)
|
|
|
|
|
self.palette = palette
|
|
|
|
|
|
|
|
|
|
def _handleNearestColors(self, color):
|
|
|
|
|