Code Sketch


Butterfly
By: Manisha Chodankar
Category: Art
cleari


setBackgroundH(Color(10, 10, 9, 119), Color(23, 228, 225))

def shape3 = Picture{
    right(135)
    forward(70.71)
    right(90)
    forward(70.71)
    right(90)
    forward(70.71)
    right(90)
    forward(70.71)
    right(90)
}.thatsStrokeColored(black)

def shape4 = Picture{
    right()
    forward(100)
    left(135)
    forward(70.71)
    left(90)
    forward(70.71)   
}.thatsStrokeColored(black)

def shape1 = Picture{
    right(135)
    forward(141.42)
    left(135)
    forward(200)
    left(135)
    forward(141.42)
}.thatsStrokeColored(black)

def shape5 = Picture{
    left(45)
    forward(70.71)
    left(135)
    forward(100)
    left(135)
    forward(70.71)
}.thatsStrokeColored(black)

def shape6 = Picture{
    forward(100)
    right(135)
    forward(70.71)
    right(45)
    forward(100)
    right(135)
    forward(70.71)
}.thatsStrokeColored(black)

def shape7 = Picture {
    left(45)
    forward(141.42)
    left(135)
    forward(100)
    left(90)
    forward(100)
}.thatsStrokeColored(black)

   
def butterfly = picStack(
    Picture{},
    shape6.thatsRotated(315).withFlippedX.thatsStrokeColored(green).thatsFilledWith(green),
    shape7.thatsRotated(135).thatsTranslated(-71, 0).thatsStrokeColored(Color(0, 56, 156)).thatsFilledWith(Color(0, 56, 156)),
    shape1.thatsRotated(135).withFlippedY.thatsTranslated(-72, 72).thatsStrokeColored(yellow).thatsFilledWith(yellow),
    shape3.thatsRotated(45).thatsStrokeColored(Color(0, 110, 22)).thatsFilledWith(Color(0, 110, 22)),
    shape4.thatsRotated(135).withFlippedX.thatsStrokeColored(purple).thatsFilledWith(purple),
    shape4.thatsRotated(45).withFlippedX.thatsTranslated(71, -141).thatsStrokeColored(brown).thatsFilledWith(brown),
    shape1.thatsRotated(-135).withFlippedX.thatsTranslated(71, 71).thatsStrokeColored(red).thatsFilledWith(red),
    
    )
    butterfly.draw