def rgb_to_hex(rgb):
    """
    Converts RGB tuple to a hexadecimal string
    
    Parameters
    ----------
    rgb : tuple
        RGB tuple such as (256,256,256)
    Returns
    -------
    str
        Hexadecimal string such as '#FFFFFF'
    """
    return '#%02x%02x%02x' % rgb
