def normalize(hex_code):
    """Convert hex code to six digit lowercase notation.
    """

    hex_digits = hex_code.lstrip('#')

    if len(hex_digits) == 3:
        hex_digits = ''.join(2 * c for c in hex_digits)

    return '#{}'.format(hex_digits.lower())