Pookkalam by Shijoy

Code

def spiral(l,b,x1,colors,ci,rn,rot,rep,ang):
    def r(l,b,x1,c):
        return rectangle(w=l,h=b,x=x1,y=0,fill=c,stroke='none')
    pattern = r(l=0,b=0,x1=0,c='none')
    for i in range(0,rn):
        for j in range(0,ci):
            shape = r(l=l,b=b,x1=x1-i*10,c=colors[j]) | rotate(j*10+i*10*rot[i]) | repeat(rep, rotate(ang))
            pattern = pattern + shape
    return pattern
    
ringsOuter = spiral(l=10,b=25,x1=140, colors=['#161416','#4d0c16','#dd5f2a','#d8962a','#ceb141','#cec5a3'], ci=6,rn=4,rot=[1,1,1,1],rep=6,ang=60)
ringsInner = spiral(l=8,b=20,x1=101, colors=['#728854','#3a4b32','#0f0f0b','#b8a223','#ccc6ac'],ci=5,rn=3,rot=[0,3,0],rep=7,ang=51.5)

def ring(r,w):
    patt = circle(r=0)
    for i in range(5):
        shape = circle(stroke='#150c14', stroke_width=w[i],r=r[i])
        patt = patt + shape
    return patt

RING = ring(r=[146,105,96,86,76],w=[5,3,3,3,3])

c1 = circle(r=80,fill='#32011f', stroke='none')
c2 = Circle(center=Point(x=30, y=0), radius=51, stroke_width=4, stroke='#f4ebf5')
c3 = c2 | Repeat(6, Rotate(60))
c4 = circle(r=41,fill='#510a56',stroke_width=2)
c5 = Circle(center=Point(x=30, y=0), radius=51, stroke_width=8, stroke='#150c14')
c6 = c5 | repeat(6, rotate(60))
c7 = circle(r=22,fill='#610f15',stroke_width=2)
c8 = circle(r=17,fill='#bb4920',stroke_width=2)
c9 = circle(r=12,fill='#c5cd59',stroke_width=2)

C = c6+c3+c4

e1 = ellipse(w=144,h=78, stroke='none', fill='#b30640') | rotate(30)
e2 = ellipse(w=144,h=78, stroke='none', fill='#b30640') | rotate(150)
e3 = ellipse(w=144,h=78, stroke='none', fill='#6c0527') | rotate(90)
E = e1+e2+e3

def square(s,c,str):
    return rectangle(h=s,w=s,fill=c,stroke=str,stroke_width=3)

sq1 = square(s=55,str='',c='none') | repeat(2, rotate(45))
sq2 = square(s=55,c='#360852',str='none') | repeat(2, rotate(45))
sq3 = square(s=40,str='',c='none') | rotate(22) | repeat(2, rotate(45))
sq4 = square(s=40,c='#3f346f',str='none') |rotate(22)| repeat(2, rotate(45))
sqr=sq1+sq2+sq3+sq4
show(ringsOuter+c1+E+C+ringsInner+RING+sqr+c7+c8+c9)