import hashlib


def string_to_hex_color(input_string):
    """
    Takes any string, generates a pseudo-random color from it. Used to generate colors for e.g. families.

    :param input_string: base string to generate a color from
    :return: a semi random color in #fff format
    """
    hashed_string = hashlib.sha1(str(input_string).encode('utf-8')).hexdigest()
    color = "#" + hashed_string[0:3].upper()

    return color