build_emoji: Fix the coloring of the white emojis.

Fix the coloring of the white emojis to match that of the images
in the iamcal's spritesheets.
This commit is contained in:
Harshit Bansal 2017-05-16 17:53:41 +00:00 committed by Tim Abbott
parent 0b2388bda9
commit 0667297c6e
1 changed files with 9 additions and 3 deletions

View File

@ -104,9 +104,15 @@ def color_font(name, code_point, code_point_to_fname_map):
try:
if name in white_emojis:
white_emoji_image = Image.open(in_name).convert('RGBA')
# Paste blue onto the image using the number as a mask
white_emoji_image.paste('#40C0E7', white_emoji_image)
white_emoji_image.save(in_name)
# Reduced image size for having a 4-pixel dark yellow background
# on right and bottom of the image.
light_yellow_background = Image.new('RGBA', (124, 124), '#FCC21B')
dark_yellow_background = Image.new('RGBA', SIZE, '#F79329')
# Paste the image on a light yellow background and the resulting
# image on a dark yellow background.
light_yellow_background.paste(white_emoji_image, mask=white_emoji_image)
dark_yellow_background.paste(light_yellow_background, mask=light_yellow_background)
dark_yellow_background.save(in_name)
shutil.copyfile(in_name, out_name)
except IOError:
raise MissingGlyphError('code_point: %r' % (code_point))