diff options
| author | 2018-11-14 12:19:31 +0000 | |
|---|---|---|
| committer | 2018-11-14 12:19:31 +0000 | |
| commit | 76d9face44f9e60dd89b139ad9f94f0840c65fad (patch) | |
| tree | 88c12359c218b5e0f00f7f9348fb764ff607cb54 /src | |
| parent | Support irc format full reset (\x0F) as ansi reset (\033[0m) (diff) | |
| signature | ||
You can join color and bold in to one \033 ansi sequence
Diffstat (limited to 'src')
| -rw-r--r-- | src/utils/irc.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/utils/irc.py b/src/utils/irc.py index 4a99caca..4a74259f 100644 --- a/src/utils/irc.py +++ b/src/utils/irc.py @@ -201,10 +201,11 @@ def to_ansi_colors(s: str) -> str: replace += utils.consts.ANSI_BOLD_RESET color = True - replace += utils.consts.ANSI_FORMAT % foreground.ansi + foreground_s = str(foreground.ansi).zfill(2) if foreground.color_bold: color_bold = True - replace += utils.consts.ANSI_BOLD + foreground_s = "%s;1" % foreground_s + replace += utils.consts.ANSI_FORMAT % foreground_s else: if color: replace += utils.consts.ANSI_COLOR_RESET |
