kittsville / pride-flag-generator

Procedurally generates an infinite number of pride flags
https://myflag.lgbt
MIT License
1 stars 2 forks source link

Support flags with shapes #5

Open kittsville opened 4 years ago

kittsville commented 4 years ago

I would like to create flags with coloured shapes e.g. progress flag

This would involve coloured squares, triangles and circles which overlay the bars.

Related to #3

kittsville commented 4 years ago

I'll start by adding arrow support. How to implement this depends on what you consider the underlying logic to flag creation. Daniel Quasar describes the arrows as being "half sized stripes" so let's try halfing the width of any flag's bars then displacing the arrows relative to the flag's left corners e.g.

kittsville commented 4 years ago

I just assumed equilateral triangles had an angle of 45°. How did I get to A Level maths and through a CS degree?

kittsville commented 4 years ago

Created a mockup but it wasn't appearing as expected because the progress pride flag has a ratio of 5:3. This is presumably because it was created with flags in mind, which are typically 5ft by 3ft. This raises the issue I was hoping to avoid until later that flags have many different ratios: #9
Pride flag mockup using 3:2 ratio

Perhaps allow the flag to specify a ratio and resize the canvas on rendering? Any procedural generation of flags would then need to check if the flag contains arrows and avoid narrow ratios such as 3:2. Alternatively we can switch to 5:3 as the default and kick #9 down the road to deal with at a future date.

kittsville commented 4 years ago

I'm going to choose the lazy option and switch to 5:3.