Pookkalam by Salman Nazeer

Code

import math
bg = rectangle(fill="MintCream",h=300, w=300)
# center rhombus
rhombus = circle(r=0)
for i in range(256):
    stroke=color(r=0, g=i, b=255)
    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_flower = rhombus | repeat(36, rotate(10)) 


red_petal = circle(r=0)
for i in range(100):
    red_petal+=circle(r=i,x=1.5*i, fill="", stroke=color(r=255-i,g=0,b=0), stroke_width=5)
red_petal = red_petal | scale(-0.5) | scale(y=0.5) | translate(x=130)
red_flower = red_petal | rotate(30) | repeat(6, rotate(60)) 

leaf = circle(r=0)
for i in range(100):
    leaf+=circle(r=i,x=1.5*i, fill="", stroke=color(r=0,g=255-i,b=0), stroke_width=5)
leaf = leaf | scale(-0.5) | scale(y=0.5) | translate(x=130)
leaves = leaf  | repeat(6, rotate(60)) 

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)

hex_center = circle(r=0)
for i in range(256):
    hex_center += hexagon(stroke=color(r=255,g=255,b=i), d=i)
hex_center = hex_center | scale(0.1)  

small_red_flower = red_flower | scale(0.2)
small_green_flower = leaves | scale(0.2)

white_flower = ellipse(w=100,h=25,x=50,fill="Navy", stroke="#AAA") | repeat(8, rotate(45)) | scale(0.2)
bg_circle = circle(stroke="#CCC",stroke_width=5,fill="#FFA500", r=140)
blue_circle = circle(r=125, fill="DeepSkyBlue", stroke="#AAA", stroke_width=5)

white_flower_circle = small_green_flower+white_flower | translate(50) | repeat(6, rotate(60))

show(bg,bg_circle,blue_circle, rhombus_flower, leaves,red_flower, hex_center)
show(small_green_flower, small_red_flower)
show(white_flower_circle)