Code Sketch


Beautiful diya
By: Nazima Baig

//To draw circle
//clear()
//setSpeed(fast)
//right(360, 150)
//right(360, 50)

////to draw rounded square
//clear()
//setSpeed(fast)
//repeat(4) {
//    forward(100)
//    right(90,30)
//}


////to draw  circle pattern and color tranparency
//clear()
//setSpeed(fast)
//setPenColor(yellow.fadeOut(0.5))
//
//repeat(360/20) {
//    setFillColor(randomColor.fadeOut(0.61))
//    right(360,100)
//    right(20)
//}

//to draw  circle pattern and color tranparency and background
//cleari()
//setBackgroundH(cm.yellow, white)
//
//setSpeed(fast)
//setPenColor(yellow.fadeOut(0.5))
//
//repeat(360/20) {
//    setFillColor(randomColor.fadeOut(0.61))
//    right(360,100)
//    right(20)
//}
//hop(270)
//setPenFontSize(60)
//setPenColor(magenta)
//changePosition(-170,-100)
//write("My Kojo image")

//to draw  circle pattern and color tranparency(fadeout) and background
//cleari()
//setBackgroundH(cm.yellow, white)
//
//setSpeed(fast)
//setPenColor(yellow.fadeOut(0.5))
//
//repeat(360/20) {
//    setFillColor(randomColor.fadeOut(0.61))
//    right(360,100)
//    right(20)
//}
//hop(270)
//setPenFontSize(60)
//setPenColor(magenta)
//changePosition(-170,-100)
//write("My Kojo image")


//cleari()
//setBackgroundH(cm.yellow, white)
//
//setSpeed(fast)
//setPenColor(white.fadeOut(0.5))
//
//repeat(360/20) {
//    setFillColor(randomColor)
//    right(360,100)
//    right(20)
//}
//hop(300)
//setPenFontSize(60)
//setPenColor(magenta)
//changePosition(-180,-100)
//write("My Kojo image")

//Program o make Diya

    
clear()
setSpeed(superFast)
def backgroundColor = cm.radialMultipleGradient(
                0, 0,
                500,
                Seq(0,0.5,0.8),
                Seq(yellow, white, green),
                false)
                
 setBackground(backgroundColor)
 
//showAxes()
//showGrid()
def baseColor= cm.linearGradient(
        0, 0, 
        Color(20, 51, 0, 81), 
        200, 0, 
        brown, 
        true)
setFillColor(baseColor)
//right
//hop(200)
//right()
//right(180,200)

//Base
right
hop(200)
right()
right(180,200)

//left arc
right(120)
left(60,200)

//right arc
left(60)
right(120)
left(60,200)
penUp()
left(-60,200)
right(60)
penDown()

//Diya
def diyaColor = cm.radialMultipleGradient(
                0, 0,
                200,
                Seq(0,  0.25,  0.6),
                Seq(red, yellow, orange),
                false)
                
setFillColor(diyaColor)

right(30)
left(60,200)
left(150)


right(30)
left(60,200)
left(150)