Last active
January 22, 2023 00:28
-
-
Save polarities/1bdf53a04575320173d4c4856c8e02e5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def ascii2color(string:str): | |
string = string.lower() | |
color = tuple(ord(string[i]) if i < len(string) else 0 for i, v in enumerate(range(3))) | |
return '#%02x%02x%02x' % color |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment