"""Regenerate the app's simple book mark. Requires Pillow; not needed to build the app."""
from pathlib import Path
from PIL import Image, ImageDraw

out = Path(__file__).parent
image = Image.new('RGBA', (1024, 1024))
draw = ImageDraw.Draw(image)
draw.rounded_rectangle((24, 24, 1000, 1000), radius=250, fill='#286b53')
left = [(512, 720), (474, 689), (430, 676), (300, 676), (270, 659), (260, 633), (260, 324), (270, 300), (300, 290), (420, 290), (463, 303), (495, 325), (512, 350), (512, 720)]
right = [(1024-x, y) for x, y in left]
draw.line(left, fill='white', width=33, joint='curve')
draw.line(right, fill='white', width=33, joint='curve')
image.save(out / 'icon.png')
image.save(out / 'icon.ico', sizes=[(n, n) for n in (16, 24, 32, 48, 64, 128, 256)])
image.save(out / 'icon.icns')
