Pookkalam by Afnitha

Code

c = circle()
show(c)
import math
bg = rectangle(fill="black",h=300, w=300)
# center rhombus
rhombus = circle(r=0)
for i in range(256):
    stroke=color(r=i, g=255-i, b=0)
    rhombus += rectangle(w=255, h=1, y=-125+i, stroke=stroke)

rhombus = rhombus | rotate(45) | scale(0.2) | scale(y=0.3) | translate(x=110)
rhombus = rhombus | repeat(36, rotate(10)) 

# center petals
center_petal = circle(r=0)
for i in range(100):
    center_petal+=circle(r=i,x=1.5*i, fill="", stroke=color(r=255-i,g=0,b=0), stroke_width=5)
center_petal = center_petal | scale(-0.5) | scale(y=0.5) | translate(x=120)
center_petal = center_petal | rotate(45) | repeat(4, rotate(90)) | scale(0.5)

# center circles / pollen
pollen = circle(r=i, fill="yellow", stroke="orange", stroke_width=5) 

# outer flowers
outer_flower = center_petal | repeat(2, rotate(45)) | translate(x=200) | scale(0.5)
outer_flower = outer_flower | repeat(8, rotate(60))
# hexagon
def hexagon(fill="none", stroke="black", stroke_width=1, x=0, y=0, d=100): # d is diagonal length
    points = []
    for i in range(0,360,60):
        rad = math.radians(i)
        points.append(point(x=math.cos(rad)*d,y=math.sin(rad)*d))
    return polygon(points,  fill=fill, stroke=stroke, stroke_width=stroke_width)

outer_hexagon = circle(r=0)
for i in range(0,120,10): 
    outer_hexagon+=hexagon(d=i, stroke_width=10, stroke=color(r=255-2*i,g=100,b=200))

white_flower = ellipse(w=10, fill="white") |translate(x=100) | repeat(36, rotate(10))
white_flower += ellipse(w=10, fill="white") |translate(x=85) | repeat(36, rotate(10))
inner = hexagon(fill="gold", d=80, stroke="none") | repeat(4, rotate(90))
show(bg, rhombus,outer_hexagon,white_flower,inner,outer_flower, outer_flower|repeat(4, rotate(45)|scale(0.5)))