From a87196c608a237968918d1c21985926850001598 Mon Sep 17 00:00:00 2001 From: jesopo Date: Fri, 21 Sep 2018 11:38:55 +0100 Subject: Change Utils.color to take a string to wrap in color --- Utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Utils.py') diff --git a/Utils.py b/Utils.py index e2da0c43..40445606 100644 --- a/Utils.py +++ b/Utils.py @@ -156,12 +156,12 @@ FONT_BOLD, FONT_ITALIC, FONT_UNDERLINE, FONT_INVERT = ("\x02", "\x1D", "\x1F", "\x16") FONT_COLOR, FONT_RESET = "\x03", "\x0F" -def color(foreground, background=None): +def color(s, foreground, background=None): foreground = str(foreground).zfill(2) if background: background = str(background).zfill(2) - return "%s%s%s" % (FONT_COLOR, foreground, - "" if not background else ",%s" % background) + return "%s%s%s%s%s" % (FONT_COLOR, foreground, + "" if not background else ",%s" % background, s, FONT_COLOR) def bold(s): return "%s%s%s" % (FONT_BOLD, s, FONT_BOLD) -- cgit v1.3.1-10-gc9f91