(rgb)
return colour
Convert a given rgb value to an integer

    :type rgb: list|tuple
    :rtype: int
Convert a given rgb value to an integer
Convert a given rgb value to an integer
def rgb2int(rgb):
    """Convert a given rgb value to an integer

    :type rgb: list|tuple
    :rtype: int

    """
    is_tuple = isinstance(rgb, tuple)
    rgb = list(rgb) if is_tuple else rgb

    colour = (int(rgb[0]*255) << 16) + (int(rgb[1]*255) << 8) + int(rgb[2]*255)
    return colour
def rgb2int ( rgb ) : is_tuple = isinstance ( rgb , tuple ) rgb = list ( rgb ) if is_tuple else rgb colour = ( int ( rgb [ 0 ] * 255 ) << 16 ) + ( int ( rgb [ 1 ] * 255 ) << 8 ) + int ( rgb [ 2 ] * 255 ) return colour