Skip to content

Commit

Permalink
Merge pull request #25 from kaunta/i12
Browse files Browse the repository at this point in the history
add different shapes
  • Loading branch information
kaunta committed Dec 7, 2019
2 parents 18a94be + 7af43e6 commit a8604b8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pacific-factbook/flag.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@ def generate() -> str:
aspect_ratio = choice([Fraction("2/3"), Fraction("1/2")])
height = 200
width = height / aspect_ratio
shape = choice(
[
f"""<circle cx="50" cy="50" r="40" stroke="{color_shape}" stroke-width="4" fill="{color_shape}" />""",
f"""<polygon points=" 50,5 20,99 95,39 5,39 80,99 " style="fill:{color_shape};stroke:{color_shape};stroke-width:4;fill-rule:nonzero;" />""",
]
)
return f"""
<svg width="{width}" height="{height}" style="border: 1px solid black">
<rect width="100%" height="100%" fill="{color_background}"/>
<circle cx="50" cy="50" r="40" stroke="black" stroke-width="4" fill="{color_shape}" />
{shape}
</svg>
"""

Expand Down

0 comments on commit a8604b8

Please sign in to comment.