hash_colorize code should first be looked up in HASH_COLORS
This commit is contained in:
parent
727fb3427d
commit
b7bfd414be
1 changed files with 2 additions and 2 deletions
|
@ -43,8 +43,8 @@ def color(s: str, foreground: consts.IRCColor,
|
||||||
|
|
||||||
HASH_COLORS = list(range(2, 16))
|
HASH_COLORS = list(range(2, 16))
|
||||||
def hash_colorize(s: str):
|
def hash_colorize(s: str):
|
||||||
code = sum(ord(c) for c in s.lower())%len(HASH_COLORS)
|
hash_code = sum(ord(c) for c in s.lower())%len(HASH_COLORS)
|
||||||
return color(s, consts.COLOR_CODES[code])
|
return color(s, consts.COLOR_CODES[HASH_COLORS[hash_code]])
|
||||||
|
|
||||||
def bold(s: str) -> str:
|
def bold(s: str) -> str:
|
||||||
return "%s%s%s" % (consts.BOLD, s, consts.BOLD)
|
return "%s%s%s" % (consts.BOLD, s, consts.BOLD)
|
||||||
|
|
Loading…
Reference in a new issue