def rgb_to_hex(r, g, b):
    """Turn an RGB float tuple into a hex code.

    Args:
        r (float): R value
        g (float): G value
        b (float): B value

    Returns:
        str: A hex code (no #)
    """
    r_int = round((r + 1.0) / 2 * 255)
    g_int = round((g + 1.0) / 2 * 255)
    b_int = round((b + 1.0) / 2 * 255)

    r_txt = "%02x" % r_int
    b_txt = "%02x" % b_int
    g_txt = "%02x" % g_int

    return r_txt + g_txt + b_txt