aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar jesopo2018-11-26 17:23:11 +0000
committerGravatar jesopo2018-11-26 17:23:11 +0000
commitf93e3f927f0a1c068ae7016d1ca60e6271a3eae0 (patch)
treeb636aa5a33ecaaef75287a81e6709d1dbe19dc54 /src
parentuse '~' instead of '±' to represent "changed files" in modules/github.py (diff)
signature
If a color code is double-digit, make sure it's 0-15, not just 0-20
Diffstat (limited to 'src')
-rw-r--r--src/utils/irc.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/utils/irc.py b/src/utils/irc.py
index 2d7663e0..09944a6f 100644
--- a/src/utils/irc.py
+++ b/src/utils/irc.py
@@ -157,12 +157,13 @@ def _color_tokens(s: str) -> typing.List[str]:
for char in s:
if is_color:
- can_add = True
- current_color = background if is_background else foreground
- if current_color:
- can_add = int(current_color) < 2
+ can_add = char.isdigit()
+ if can_add:
+ current_color = background if is_background else foreground
+ if current_color:
+ can_add = int(current_color) < 2 and int(char) < 6
- if char.isdigit() and can_add:
+ if can_add:
if is_background:
background += char
else: