def hex_to_rgb(txt):
    """Turn a hex color code string into an RGB tuple.

    RGB tuples are floats on the interval [-1.0, 1.0].

    Args:
        txt (str): The hex string (6 chars, no #)

    Returns:
        A 3-tuple of R, G, and B floats.
    """
    r_txt = txt[0:2]
    g_txt = txt[2:4]
    b_txt = txt[4:6]

    r_int = int(r_txt, base=16)
    g_int = int(g_txt, base=16)
    b_int = int(b_txt, base=16)

    r = 2 * r_int / 255 - 1.0
    g = 2 * g_int / 255 - 1.0
    b = 2 * b_int / 255 - 1.0

    return r, g, b