python实现按键精灵之颜色格式转换RGB vs HEX

def rgb2hex(rgbcolor):
    '''RGB转HEX
    :param rgbcolor: RGB颜色元组,Tuple[int, int, int]
    :return: str
    '''
    r, g, b = rgbcolor
    result = (r << 16) + (g << 8) 

你可能感兴趣的:(史沐凡,python)