def html_to_float(c):
    """
    Convert a HTML hex color to a Red-Green-Blue (RGB) tuple.

    INPUT:

    - ``c`` - a string; a valid HTML hex color

    OUTPUT:

    - a RGB 3-tuple of floats in the interval [0.0, 1.0]

    EXAMPLES::

        sage: from sage.plot.colors import html_to_float
        sage: html_to_float('#fff')
        (1.0, 1.0, 1.0)
        sage: html_to_float('#abcdef')
        (0.6705882352941176, 0.803921568627451, 0.9372549019607843)
        sage: html_to_float('#123xyz')
        Traceback (most recent call last):
        ...
        ValueError: invalid literal for int() with base 16: '3x'
    """
    if not len(c) or c[0] != '#':
        raise ValueError("'%s' must be a valid HTML hex color (e.g., '#f07' or '#d6e7da')" % c)
    h = c[1:]
    if len(h) == 3:
        h = '%s%s%s%s%s%s' % (h[0], h[0], h[1], h[1], h[2], h[2])
    elif len(h) != 6:
        raise ValueError("color hex string (= '%s') must have length 3 or 6" % h)
    return tuple([int(h[i:i + 2], base=16) / 255 for i in [0, 2, 4]])