def get_avatar_tone_map(tone='skin', skinTone=''): tones = { 'D68876': 0, 'BC8269': 0, 'EEE3C1': 0, 'FFCAA6': 0, 'D68876': 0, 'FFDBC2': 0, 'F4B990': 0, #base } base_3d_tone = 'F4B990' if tone == 'blonde_hair': tones = { 'CEA578': 0, 'BA7056': 0, 'F4C495': 0, } base_3d_tone = 'CEA578' if tone == 'brown_hair': tones = { '775246': 0, '563532': 0, 'A3766A': 0, } base_3d_tone = '775246' if tone == 'brown_hair2': tones = { '683B38': 0, 'A56860': 0, '7F4C42': 0, } base_3d_tone = '683B38' if tone == 'dark_hair': tones = { '4C3D44': 0, '422D39': 0, '6D5E66': 0, '5E4F57': 0, '9B8886': 0, '896F6B': 0, '84767E': 0, '422C37': 0, } base_3d_tone = '6D5E66' if tone == 'grey_hair': tones = { '7C6761': 0, '5E433D': 0, 'AA8B87': 0, } base_3d_tone = '7C6761' #mutate_tone for key in tones.keys(): delta = sub_rgb_array(hex_to_rgb_array(key), hex_to_rgb_array(base_3d_tone), False) rgb_array = add_rgb_array(delta, hex_to_rgb_array(skinTone), True) tones[key] = rgb_array_to_hex(rgb_array) return tones
def get_avatar_tone_map(tone='skin', skinTone='', theme='unisex'): tones = { 'D68876': 0, 'BC8269': 0, 'EEE3C1': 0, 'FFCAA6': 0, 'D68876': 0, 'FFDBC2': 0, 'D7723B': 0, #base 'F4B990': 0, 'CCB293': 0, # base - comic 'EDCEAE': 0, # base - flat 'F3DBC4': 0, # base - flat } base_3d_tone = 'F4B990' if theme == 'female': base_3d_tone = 'FFCAA6' if theme == 'comic': base_3d_tone = 'CCB293' if tone == 'blonde_hair': tones = { 'F495A8': 0, 'C6526D': 0, 'F4C495': 0, } base_3d_tone = 'CEA578' if tone == 'brown_hair': tones = { '775246': 0, '563532': 0, 'A3766A': 0, } base_3d_tone = '775246' if tone == 'brown_hair2': tones = { '683B38': 0, 'A56860': 0, '7F4C42': 0, } base_3d_tone = '683B38' if tone == 'dark_hair': tones = { '4C3D44': 0, '422D39': 0, '6D5E66': 0, '5E4F57': 0, '9B8886': 0, '896F6B': 0, '84767E': 0, '422C37': 0, } base_3d_tone = '6D5E66' if tone == 'grey_hair': tones = { '7C6761': 0, '5E433D': 0, 'AA8B87': 0, } base_3d_tone = '7C6761' if tone == 'comic_hair': tones = {'8C6239': 0} base_3d_tone = '8C6239' if tone == 'comic_background': tones = {'9B9B9B': 0} base_3d_tone = '9B9B9B' if tone == 'flat_background': tones = {'A6D9EA': 0} base_3d_tone = 'A6D9EA' if tone == 'flat_skin': tones = { 'EDCEAE': 0, 'F3DBC4': 0, 'E4B692': 0, 'F3DBC4': 0, 'EDCEAE': 0, 'F1C9A5': 0, } base_3d_tone = 'EDCEAE' if tone == 'metacartel_skin': tones = { 'ED495F': 0, } if tone == 'mage_skin': tones = { 'FFEDD9': 0, } base_3d_tone = 'FFEDD9' if tone == 'barb_skin': tones = { 'F7D3C0': 0, } base_3d_tone = 'F7D3C0' if tone == 'orc_skin': tones = { 'FFFF99': 0, } base_3d_tone = 'FFFF99' if tone == 'terran_skin': tones = { 'FFD9B3': 0, } base_3d_tone = 'FFD9B3' if tone == 'starbot_skin': tones = { 'FFFFFF': 0, } base_3d_tone = 'FFFFFF' if tone == 'wookie_skin': tones = { 'AE7343': 0, } base_3d_tone = 'AE7343' if tone == 'wolverine_skin': tones = { 'ECE3C1': 0, } base_3d_tone = 'ECE3C1' if tone == 'orc_hair': tones = { '010101': 0, } base_3d_tone = '010101' if tone == 'squarebot_background': tones = {'009345': 0, '29B474': 0} base_3d_tone = '29B474' if tone == 'squarebot_skin': tones = { '29B473': 0, } base_3d_tone = '29B473' if tone == 'cj_hair': tones = { 'CCA352': 0, } base_3d_tone = 'CCA352' if tone == 'cj_skin': tones = { 'D99678': 0, } base_3d_tone = 'D99678' if tone == 'people_skin': tones = { 'FFE1B2': 0, 'FFD7A3': 0, } base_3d_tone = 'FFE1B2' if tone == 'people_hair': tones = { 'FFD248': 0, '414042': 0, 'A18369': 0, 'E7ECED': 0, '8C6239': 0, '9B8579': 0, '8C6239': 0, } base_3d_tone = 'FFD248' if tone == 'shiny_skin': tones = { 'FFD3AE': 0, '333333': 0, 'FFD3AE': 0, 'E8B974': 0, 'EDCEAE': 0, } base_3d_tone = 'FFD3AE' if tone == 'shiny_hair': tones = { 'D68D51': 0, 'F7774B': 0, 'E8B974': 0, 'F7B239': 0, 'D3923C': 0, '666666': 0, } base_3d_tone = 'D68D51' if tone == 'flat_hair': tones = { '682234': 0, '581A2B': 0, '10303F': 0, '303030': 0, '265A68': 0, '583A2F': 0, 'D1874A': 0, 'E1A98C': 0, 'D2987B': 0, '3C2A20': 0, 'C64832': 0, 'B2332D': 0, 'A0756F': 0, '8C6762': 0, '471B18': 0, '5A3017': 0, 'EC9A1C': 0, '545465': 0, '494857': 0, '231F20': 0, '0F303F': 0, } base_3d_tone = '8C6239' #mutate_tone for key in tones.keys(): delta = sub_rgb_array(hex_to_rgb_array(key), hex_to_rgb_array(base_3d_tone), False) rgb_array = add_rgb_array(delta, hex_to_rgb_array(skinTone), True) tones[key] = rgb_array_to_hex(rgb_array) print(tone, key, tones[key]) return tones