Skip to content
Permalink
6a5dc0eadc
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
11 lines (8 sloc) 268 Bytes
"""
A set of functions designed to work with colors for websites
"""
import hashlib
def string_to_hex_color(input_string):
hashed_string = hashlib.sha1(str(input_string).encode('utf-8')).hexdigest()
color = "#" + hashed_string[0:3].upper()
return color