Code
from datetime import date
import unicodedata
def drawConcentricCircles(size,radius,color):
for i in range(2):
concentric_cicle=circle(x=size, y=0, r=radius[i],stroke=color[i]) | repeat(50, rotate(20))
show(concentric_cicle)
# ------------ code begins ------------
drawConcentricCircles(170,[6,3],['#c92a2a','#f76707'])
# ********************* OUTER SECTION *********************
darkRed = rectangle(w=230, h=230,fill='#c92a2a',stroke='none') | repeat(10, rotate(10))
lightRed =rectangle(w=210, h=210,fill='#e03131',stroke='none') | repeat(10, rotate(10))
darkOrange=rectangle(w=200, h=200,fill='#f76707',stroke='#fff') | repeat(10, rotate(10))
lightOrange= rectangle(w=175, h=175, fill='#ff922b', stroke='#fff') | rotate(10) | repeat(10, rotate(50))
darkYellow=rectangle(w=170, h=170,fill='#f08c00',stroke='#fff') | repeat(9, rotate(10))
lightYellow = rectangle(w=150, h=150,fill='#ffa94d',stroke='#fff') | repeat(9, rotate(10))
show(darkRed,lightRed,darkOrange,darkYellow,lightOrange,lightYellow)
# -------------- Outer green ellipse --------------
innerGreenEllipse = ellipse(w=185,h=70, fill="#2b8a3e" , stroke="#fff") | repeat(80,rotate(100))
show(innerGreenEllipse)
# -------------- Outer flower like section --------------
redFloralLayer=ellipse(h=150,w=30,fill="#ff922b",stroke="none")|rotate(15)|repeat(150,rotate(20))
orangeFloralLayer=ellipse(h=150,w=30,fill="#c92a2a",stroke="#fff")|rotate(10)|repeat(100,rotate(20))
innerWhiteCircle=circle(r=55,fill="#fff",stroke="none")
show(redFloralLayer,orangeFloralLayer,innerWhiteCircle)
drawConcentricCircles(60,[3,1],['#fff','#ffa94d'])
# ********************* Inner section *********************
redInnerLayer = rectangle(w=75, h=75, fill="#e03131", stroke='#fff') | repeat(3, rotate(30))
yellowInnerLayer =rectangle(w=65, h=65, fill="#ffa94d", stroke='#fff') | repeat(3, rotate(30))
whiteInnerLayer = rectangle(w=55, h=55, fill="#fff", stroke='#fff') | repeat(5, rotate(30))
show(redInnerLayer, yellowInnerLayer,whiteInnerLayer)
# ------------ Drawing Kathakali --------------
crownTop1=circle(r=25,fill='#f08c00',stroke='none',stroke_width=2)
show(crownTop1)
faceTopPart=circle(y=-30,r=25,fill='#37b24d',stroke='none')
faceBottomPart=ellipse(y=-43,w=70,h=35,fill='#e9ecef',stroke='none') | scale(0.7)
crown=circle(r=27,fill='#e03131',stroke='none')
crownRings=circle(r=27,stroke='#ffa94d')| repeat(7,translate(y=-5))
crown=combine([crown,crownRings,faceTopPart]) | scale(0.7)
earings=circle(x=5,r=1,fill='#b72918',stroke='none')|repeat(8,rotate(45))
earings_left=earings|translate(x=-29,y=-24)
earings_right=earings|translate(x=29,y=-24)
eyebrow1=line(x1=3,y1=-30,x2=17,y2=-25,stroke_width=1,stroke='black')
eyebrow2=line(x1=-3,y1=-30,x2=-17,y2=-25,stroke_width=1,stroke='black')
eye1=line(x1=3,y1=-34,x2=17,y2=-34,stroke_width=1,stroke='black')
eye2=line(x1=-3,y1=-34,x2=-17,y2=-34,stroke_width=1,stroke='black')
lips=line(x1=-10,y1=-44,x2=9,y2=-44,stroke_width=1,stroke='red')
facial_features=combine([earings_left,earings_right,eyebrow1,eyebrow2,eye1,eye2,lips])| scale(0.7)
show(faceBottomPart,crown,facial_features)
# ------------- Displaying the corresponding day of onam -------------
tenDaysOfOnam= { 1:'അത്തം', 2:'ചിത്തിര',3:'ചോതി', 4:'വിശാഖം', 5:'അനിഴം',
6:'തൃക്കേട്ട',7:'മൂലം',8:'പൂരം',9:'ഉത്രാടം', 10:'തിരുവോണം'}
todays_date = date.today().strftime("%d")
# Atham starts on Aug11 and it is the first day
# So to get the current day of onam, subtract 10 from current date
dayOfOnam= int(todays_date)-10
if dayOfOnam<=10:
date=tenDaysOfOnam[dayOfOnam]
print('\n'+str('ഇന്ന് ')+todays_date+str( ' ഓഗസ്റ്റ്: ')+ date)
onam_wishs='ഓണപൂക്കളങ്ങളിൽ നിറയുന്ന ശോഭയാർന്ന പൂക്കൾ പോലെ, \n നിങ്ങളുടെജീവിതം മനോഹരവും സുഗന്ധപൂരിതവുമാകട്ടെ.\n എല്ലാവർക്കും ഒരായിരം ഓണാശംസകൾ!'
print('\n',onam_wishs)