Pookkalam by Muzu

Code

c = circle(r=150, fill='#341118')

show(c)

def square(color, side):

    return rectangle(w=side, h=side, fill=color, stroke='none')

def logo():

    r1 = rectangle(w=105, h=50, fill='#2CC0CF', stroke='none', x=-45, y=70) 

    r2 = rectangle(w=50, h=50, fill='#2078F9', stroke='none', x=50, y=70)

    layer1 = r1 + r2

    layer2 = rectangle(w=175, h=50, fill='#FECD3D', stroke='none', x=-12, y=0) 

    r1 = rectangle(w=70, h=50, fill='#EE3C35', stroke='none', x=-65, y=-70) 

    r2 = rectangle(w=42, h=50, fill='#91BF23', stroke='none', x=0, y=-70) 

    r3 = rectangle(w=42, h=50, fill='#045768', stroke='none', x=52, y=-70) 

    layer3 = r1 + r2 + r3

    return combine([layer1, layer2, layer3]) | scale(0.08) | translate(x=1)

def oval():

    p1 = point(x=-5, y=50)

    p2 = point(x=5, y=50)

    p3 = point(x=0, y=100)

    polygon1 = polygon([p1, p2, p3], fill='#FF0000', stroke='none')

    inner_ring = ellipse(w=40, h=50, x=0, y=65, fill='#AE2924', stroke='none')

    inner_ring1 = ellipse(w=40, h=50, x=0, y=55, fill='#E65A99', stroke='none')

    inner_ring2 = ellipse(w=40, h=50, x=0, y=45, fill='white' ,stroke='none')

    inner_ring3 = ellipse(w=40, h=50, x=0, y=35, fill='#4B0082', stroke='none')

    triangle_ring = inner_ring + inner_ring1 + inner_ring2 + polygon1 + inner_ring3 | rotate(45) | repeat(8, rotate(45))

    return triangle_ring

# OUTER LAYER

orangered_layer = square(side=212.5,color='#FF4500') | repeat(10,  rotate(10)) 

orange_layer = square(side=198, color='#FFA500') | rotate(5) | repeat(10,  rotate(10)) 

yellow_layer = square(side=182, color='#FFD700') | repeat(10,  rotate(10)) 

white_layer = square(side=168, color='white') | rotate(5) | repeat(10,  rotate(10)) 

red_layer = square(side=155, color='#a92822')  | repeat(10,  rotate(10))

show(orangered_layer,orange_layer, yellow_layer, white_layer)

# INNER LAYER

middle_c = circle(r=105, fill='#8B008B')

indigo_circle_layer = circle(x=-29,y=70,r=28, fill='#4B0082', stroke_width=3, stroke='yellow') | repeat(12, rotate(45))

white_layer = square(side=126,color='#FEFDF3') | rotate(22.5)

white_layer1 = square(side=126,color='#FEFDF3') | rotate(-22.5)

pink_layer = square(side=113,color='#E65A99') | rotate(22.5)

pink_layer1 =square(side=113,color='#E65A99') | rotate(-22.5)

red_layer = square(side=100,color='#AE2924') | rotate(22.5)

red_layer1 = square(side=100,color='#AE2924') | rotate(-22.5)

green_layer = square(side=87,color='yellow') | rotate(22.5)

green_layer1 = square(side=87,color='yellow') | rotate(-22.5)

triangle_ring = oval()

show(middle_c, indigo_circle_layer,white_layer,white_layer1, pink_layer,pink_layer1, red_layer,red_layer1,triangle_ring, green_layer,green_layer1)

# INNER RING BOX

def inner_box_ring():

    shape = rectangle(h=12, w=17, fill='#E3BD36', y=-32, stroke='none')

    for i in range(1, 13) :

        if i % 2 == 0:

            shape = shape + rectangle(h=12, w=17, fill='#E3BD36', y=-32, stroke='none') |  rotate(30)

        else:

            shape = shape + rectangle(h=12, w=17, fill='#36a810', y=-32, stroke='none') |  rotate(30)

    return shape

inner_c = circle(r=50, fill='#008000') + circle(r=26, fill='#ff4102') + inner_box_ring()

inner_button = circle(r=13, fill='black', stroke_width=3) + logo()

inner_line_ring = line(x1=13, y1=0, x2=50, y2=0, stroke_width=3) | repeat(12, rotate(30)) | rotate(15)

show(inner_c,inner_button, inner_line_ring)