from colormap import rgb2hex from colormap import hex2rgb print(rgb2hex(255, 255, 255)) print(hex2rgb('#FFFFFF')) >>> #FFFFFF >>> (255, 255, 255)