aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/irc.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/utils/irc.py b/src/utils/irc.py
index e2b2cf19..1cfe4fcc 100644
--- a/src/utils/irc.py
+++ b/src/utils/irc.py
@@ -159,12 +159,14 @@ def _color_tokens(s: str) -> typing.List[str]:
for char in s:
if is_color:
- can_add = char.isdigit()
- if can_add:
- current_color = background if is_background else foreground
+ can_add = False
+ current_color = background if is_background else foreground
+ if char.isdigit() and len(current_color) < 2:
if current_color:
next_color = int(current_color + char)
can_add = next_color <= 15 or next_color == 99
+ else:
+ can_add = True
if can_add:
if is_background: