From 76d9face44f9e60dd89b139ad9f94f0840c65fad Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 14 Nov 2018 12:19:31 +0000 Subject: [PATCH] You can join color and bold in to one \033 ansi sequence --- src/utils/irc.py | 5 +++-- 1 file 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