Derive dashboard colors from UTF-8 function names

This commit is contained in:
Andras Schmelczer 2026-10-27 20:03:07 +00:00
commit 9a61087814

View file

@ -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)