diff options
| author | 2018-09-21 11:38:55 +0100 | |
|---|---|---|
| committer | 2018-09-21 11:39:09 +0100 | |
| commit | a87196c608a237968918d1c21985926850001598 (patch) | |
| tree | 9327e021f1c1fa6258f5e9a57273bb72706b0ed3 /Utils.py | |
| parent | Don't pass around full server details more than we have to. (diff) | |
Change Utils.color to take a string to wrap in color
Diffstat (limited to 'Utils.py')
| -rw-r--r-- | Utils.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) |
