util.py 492 B

1234567891011121314151617
  1. def uni_to_hex_hash(uni):
  2. return ' '.join(map(lambda x: '#' + hex(x)[2:], uni))
  3. def uni_to_hex_filename(uni):
  4. return '-'.join(map(lambda x: hex(x)[2:], uni))
  5. def get_color_palettes(emoji, manifest):
  6. """Get the source and destination colour palettes for the given emoji."""
  7. if 'color' not in emoji:
  8. return None
  9. cmap = manifest.colormaps[emoji['color']]
  10. pfrom = manifest.palettes[cmap['src']]
  11. pto = manifest.palettes[cmap['dst']]
  12. return (pfrom, pto)