Derive dashboard colors from UTF-8 function names
This commit is contained in:
parent
1fda2d6fc0
commit
9a61087814
1 changed files with 2 additions and 2 deletions
|
|
@ -3,10 +3,10 @@ from hashlib import md5
|
||||||
|
|
||||||
|
|
||||||
def text_to_hex_color(text: str) -> str:
|
def text_to_hex_color(text: str) -> str:
|
||||||
ascii_bytes = text.encode("ascii")
|
encoded_text = text.encode("utf-8")
|
||||||
|
|
||||||
digest = md5(
|
digest = md5(
|
||||||
ascii_bytes
|
encoded_text
|
||||||
).hexdigest() # the built-in hash function is salted differently in each process
|
).hexdigest() # the built-in hash function is salted differently in each process
|
||||||
|
|
||||||
integer = int(digest, 16)
|
integer = int(digest, 16)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue