Code
# Pookalam by Akshay Jose
# Theme 'तमसो मा ज्योतिर्गमय From Darkness Lead Me to Light'
# https://mon.school/sketches/373439
# |||||||||||||||||||||||
# ||| Code A Pookalam |||
# |||||||||||||||||||||||
# A clean canvas with earthy color tone.
Background = rectangle(w=300,h=300,fill="#fcf6de", stroke="none")
show(Background)
# Let's start from outside this time by alternating color strips from dark to light.
def Outer_Strips_Layer_1():
shape = rectangle(h=295, w=5, fill='#E3BD37', y=0, stroke='none')
for i in range(4, 104) :
if i % 2 == 0:
shape = shape + rectangle(h=295, w=15, fill='#1C1116', y=0, stroke='none') | rotate(6)
else:
shape = shape + rectangle(h=295, w=15, fill='#900000', y=0, stroke='none') | rotate(6)
return shape
def Outer_Strips_Layer_2():
shape = rectangle(h=278, w=5, fill='#E3BD37', y=0, stroke='none')
for i in range(4, 104) :
if i % 2 == 0:
shape = shape + rectangle(h=278, w=14.5, fill='#900000', y=0, stroke='none') | rotate(6)
else:
shape = shape + rectangle(h=278, w=14.5, fill='#EB5400', y=0, stroke='none') | rotate(6)
return shape
def Outer_Strips_Layer_3():
shape = rectangle(h=262, w=5, fill='#E3BD37', y=0, stroke='none')
for i in range(4, 104) :
if i % 2 == 0:
shape = shape + rectangle(h=262, w=14.5, fill='#EB5400', y=0, stroke='none') | rotate(6)
else:
shape = shape + rectangle(h=262, w=14.5, fill='#E3BD36', y=0, stroke='none') | rotate(6)
return shape
def Outer_Strips_Layer_4():
shape = rectangle(h=244, w=5, fill='#E3BD37', y=0, stroke='none')
for i in range(4, 104) :
if i % 2 == 0:
shape = shape + rectangle(h=244, w=14.5, fill='#E3BD36', y=0, stroke='none') | rotate(6)
else:
shape = shape + rectangle(h=244, w=14.5, fill='#f8e63d', y=0, stroke='none') | rotate(6)
return shape
# Combining all strips.
merge_strips = combine([Outer_Strips_Layer_1(), Outer_Strips_Layer_2(), Outer_Strips_Layer_3(), Outer_Strips_Layer_4()])
layer_1 = merge_strips
# End alternating color strips with a white circle.
circle_1 = circle(r=113, fill='#ffffff', stroke='none')
# Let's create a flowering effect using squares and the concept of dark to lite in mind.
def square(color, side):
return rectangle(w=side, h=side, fill=color, stroke='none')
yellow_1 = square(side=160, color='#F8E63D') | repeat(10, rotate(10))
dark_yellow_2 = square(side=150, color='#E3BD36') | rotate(5) | repeat(10, rotate(10))
orange_3 = square(side=140, color='#F36636') | repeat(10, rotate(10))
red_4 = square(side=130, color='#a92822') | rotate(5) | repeat(10, rotate(10))
dark_red_5 = square(side=120, color='#440000') | repeat(10, rotate(10))
merge_square = combine([yellow_1, dark_yellow_2, orange_3, red_4, dark_red_5])
layer_2 = merge_square
# Now let's take a different turn by using two layers of circles in a hexagonal formation.
circle_01 = circle(x=55,y=0,r=28, fill="black")
circle_02 = circle(x=55,y=0,r=25, fill="#65020e", stroke="none")
circle_03 = circle(x=55,y=0,r=20, fill="#b73c31", stroke="none")
circle_04 = circle(x=55,y=0,r=15, fill="#ff6200", stroke="none")
circle_05 = circle(x=55,y=0,r=9, fill="#fad800", stroke="none")
circle_06 = circle(x=55,y=0,r=3, fill="#ffffff", stroke="none")
merge_circles = combine([circle_01, circle_02, circle_03, circle_04, circle_05, circle_06])
layer_3 = merge_circles | repeat(6, rotate(60))
# The second layer of circles rotated 90degree. It is also in a hexagonal formation.
circle_01 = circle(x=40,y=23,r=25, fill="black")
circle_02 = circle(x=40,y=23,r=22, fill="#65020e", stroke="none")
circle_03 = circle(x=40,y=23,r=17.5, fill="#b73c31", stroke="none")
circle_04 = circle(x=40,y=23,r=12, fill="#ff6200", stroke="none")
circle_05 = circle(x=40,y=23,r=7, fill="#fad800", stroke="none")
circle_06 = circle(x=40,y=23,r=3, fill="#ffffff", stroke="none")
merge_circles = combine([circle_01, circle_02, circle_03, circle_04, circle_05, circle_06])
layer_4 = merge_circles | repeat(6, rotate(60))
# Now let's make three layers of twelve pointed stars in yellow followed by orange and dark red color.
def square(color, side):
return rectangle(w=side, h=side, fill=color, stroke='none')
yellow = square(side=70,color='#f8e63d') | repeat(3, rotate(60))
orange = square(side=63,color='#fc5f16') | repeat(3, rotate(60))
dark_red = square(side=56,color='#600519') | repeat(3, rotate(60))
merge_square = combine([yellow, orange, dark_red])
layer_5 = merge_square
# At this point let introduce shades of purple in the form of ellipses.
# It depicts the flower lotus, a symbol of purity.
ellipse_1 = ellipse(x=0,y=0,w=15,h=35,fill="#410035",stroke='none')
ellipse_2 = ellipse(x=0,y=0,w=15,h=45,fill="#7f0569",stroke='none')
ellipse_3 = ellipse(x=0,y=0,w=15,h=55,fill="#b63da1",stroke='none')
ellipse_4 = ellipse(x=0,y=0,w=15,h=65,fill="#dc5ec6",stroke='none')
merge_ellipse = combine([ellipse_4, ellipse_3, ellipse_2, ellipse_1])
layer_6 = merge_ellipse | repeat(3, rotate(60))
ellipse_5 = ellipse(x=0,y=0,w=35,h=15,fill="#600519",stroke='none')
ellipse_6 = ellipse(x=0,y=0,w=45,h=15,fill="#af3b43",stroke='none')
ellipse_7 = ellipse(x=0,y=0,w=55,h=15,fill="#fc5f16",stroke='none')
ellipse_8 = ellipse(x=0,y=0,w=65,h=15,fill="#f7d022",stroke='none')
merge_ellipse = combine([ellipse_8, ellipse_7, ellipse_6, ellipse_5])
layer_7 = merge_ellipse | repeat(3, rotate(60))
# We are almost at the centre. Let's make three layers of circles with shades of purple.
circle_2 = circle(r=14, fill='#7f0569', stroke='none')
circle_3 = circle(r=11, fill='#b63da1', stroke='none')
circle_4 = circle(r=8, fill='#dc5ec6', stroke='none')
merge_circles = combine([circle_2, circle_3, circle_4])
layer_8 = merge_circles
# Finally, at the center let's make the 'Flower of Enlightenment' using two layers of ellipses.
ellipse_9 = ellipse(x=0,y=0,w=3,h=12,fill="#ffffff",stroke='none') | repeat(3,rotate(60))
ellipse_10 = ellipse(x=0,y=0,w=12,h=3,fill="#ffffff",stroke='none') | repeat(3,rotate(60))
merge_ellipse = combine([ellipse_9, ellipse_10])
layer_9 = merge_ellipse
circle_5 = circle(r=2, fill='#f7d022', stroke='none')
# Display all
show(layer_1, circle_1, layer_2, layer_3, layer_4, layer_5, layer_6, layer_7, layer_8, layer_9, circle_5)
# May the Spirit of Onam guide and light your way to the path you choose.
# ----Happy Onam----
# Thank you. As a graphics designer seeing my codes becoming images was an amazing experience, I am truly inspired by it. Looking forward to doing more activities like this.