def rgb2hex(rgb: list | tuple) -> int:
    """
    Excel expects a hex value in order to fill cells
    This function allows you to supply standard RGB values to be converted to hex.
    """

    if not isinstance(rgb, (tuple, list)):
        raise TypeError("Argument supplied must be a tuple or list of RGB values")
    bgr = (rgb[2], rgb[1], rgb[0])
    str_value = "%02x%02x%02x" % bgr
    hexcode = int(str_value, 16)
    return hexcode