from typing import Tuple


def rgb_to_hex_int(rgb: Tuple[int]) -> int:
    """ Converts an RGB tuple to a hex value using the method [1].
    
    Parameters
    ----------
    rgb : tuple of int
        Like (r, g, b) where the colour is represented as integer RGB components 
        between 0 and 255.
    
    Returns
    -------
    hex_int : int
        Returns an integer like 0xff0000 given the input (255, 0, 0).
    
    Notes
    -----
    In Python 0xff0000 is a shorthand for writing hexadecimal integer values. These are
    converted to base 10 integer representation. This reference [1] was useful when 
    implementing this function.

    [1] https://stackoverflow.com/questions/3380726/converting-a-rgb-color-tuple-to-a-six-digit-code-in-python
    
    """

    def clamp(x):
        return max(0, min(x, 255))

    string_value = "0x{0:02x}{1:02x}{2:02x}".format(*list(map(clamp, rgb)))
    hex_int = int(string_value, 0)
    return hex_int