Code Sketch


Multi gradient
By: Khushi jatav
Category: Art
cleari()
setSpeed(fast)
//initRandomGenerator(1686505834743L)
val cb = canvasBounds
val x = cb.x
val y = cb.y
val w = cb.width
val h = cb.height
val clr = cm.linearMultipleGradient(
    x, y,
    x, y + h,
    Seq(0, 0.5, 0.51, 1),
    Seq(Color(153, 153, 0), Color(51, 51, 0), Color(255, 204, 102), Color(0, 0, 102)),
    false)
setBackground(clr)
setPosition(-340, 0)
setPenColor(black)
setFillColor(gray)
repeat(27) {
    val x = random(30, 100)
    val w = 22
    forward(x)
    right()
    forward(w)
    right()
    forward(x)
    right()
    forward(w)
    right()
    right()
    hop(w)
    left()
}
setPosition(240, 170)
val c = cm.radialGradient(300, 170, Color(255, 102, 0),
60, Color(255, 255, 204),
false)
setPenColor(c)
setFillColor(c)
right(360,60)