Code
#colours
a = "#800000"
b = "#FF8C00"
c = "#FFD700"
d = "#FFFF00"
e = "#FFFFE0"
f = "#87CEEB"
g = "#FF6347"
g1= "#FFE4E1"
r= "#DC143C"
h=color(r=170, g=147, b=214, a=0.4) #flower petal colour
#defined function
#outer layer part
def outer_layer(clr,n):
outer_end=rectangle(x=0, y=0, h=212, w=212, fill=clr, stroke="none") | scale(n)
show(outer_end | repeat (3, rotate(30)))
def outer_arrow(arrow,n):
show(arrow | repeat (12, rotate(30)) | scale(n))
#middle layer part
def middle_flower(clr,n):
outer_flower= circle(r=18.5, x=70, fill=clr) | repeat (12, rotate(30)) | scale(n)
show(outer_flower)
#background layer
show(circle(r=150, fill="#000000"))
#outer layer
colors = [a,b,c,d,e,f]
n=1
for color in colors:
outer_layer(color,n)
n=n-0.062
#outer arrow
colors = [e,d,c,b,a]
p1 = point(x=125, y=7.5)
p2 = point(x=150, y=0)
p3 = point(x=125, y=-7.5)
p4= point(x=0, y=0)
n=1
for colour in colors:
arrow= polygon([p1,p2,p3,p4], fill=colour, stroke='none')
outer_arrow(arrow,n)
n=n-0.062
#middle layer
#middle layer background
show(circle(r=89, fill="#229922", stroke="none"))
#outer middle layer
colors = [g1, g, e]
n = 1
for colour in colors:
middle_flower(colour, n)
n = n-0.14
#inner middle layer
colors = [d, c, b, r]
n = 1
for colour in colors:
circles = circle(r=54, fill=colour, stroke="none") | scale(n)
n = n-0.1
show(circles)
show(line(x1=26.7, y1=26.7, x2=52, y2=52, stroke_width=1.3) | repeat(12, rotate(30)))
#inner layer
#inner layer circles
show(circle(x=28, y=0, r=7, fill="#000000",stroke_width=0.3) | repeat(12, rotate(30)), circle(r=28, fill=f), circle(r=19, fill=e, stroke="#BA55D3", stroke_width=6))
#inner layer flower
flower = ellipse(w=25, h=10, fill=h) | repeat(6, rotate(30))
show(flower, circle(r=5, fill=c, stroke_width=0.75))
print("Happy Onam")