Code Sketch
Gen-art created by Amatullah Kayyumi
By: Anusha Pant
0


0




cleari() size(900, 900) setSpeed(superFast) val bg = Picture { initRandomGenerator(-62829832809009001L) setPenColor(black) setPenThickness(.1) // val petals = random(3, 8) val petals = 1 def petalshape() { //val n = random(60, 90, 108, 120, 128.5) val petals = random(3, 8) repeat(petals) { if (petals == 3) { right(180, 15) left(60) } else if (petals == 4) { right(180, 15) left(90) } else if (petals == 5) { right(180, 12) left(108) } else if (petals == 6) { right(180, 12) left(120) } else { right(180, 12) left(128.5) } } } val cb = canvasBounds val nx = 10 val ny = 9 val dx = (cb.width) / (nx + 1) val dy = (cb.height) / (ny + 1) var currX = 1 var currY = 1 var heading = 90 def block1() { petalshape() // right(360.0 / petals) //right(100) } def block() { setFillColor(randomColor.fadeOut(0.85)) if (currX > nx) { currX = 1 currY += 1 } //block1() val px = cb.x + currX * dx val py = cb.y + currY * dy setPosition(px, py) setHeading(heading) currX += 1 heading += 10 block1() } repeat(nx * ny) { block() } } def fg = Picture { def sun() { initRandomGenerator(6410363842027520710L) def shape() { savePosHe() setFillColor(randomColor.fadeOut(0.3)) setPenColor(cm.gray) //left(90) right(180, 6) left(210, 13) //setPenColor(red) restorePosHe() savePosHe() left(90) right(180, 14) left(220, 6.3) restorePosHe() } def block() { shape() left(60) //right(30, 100) } repeat(6) { block() } } def oval() { sun() savePosHe() penUp() right(80, 125) //right(180) penDown() } repeat(10) { oval() } } def flur = Picture { def shape() { setPenColor(cm.grey) setFillColor(ColorMaker.hsla(332, 1.00, 0.57, 0.76)) savePosHe() left(90) right(180, 10) left(210, 17) //setPenColor(red) restorePosHe() savePosHe() left(90) right(180, 18) left(220, 9.3) restorePosHe() } def block() { shape() left(60) } repeat(6) { block() } } def words() = { def pic1() = Picture { setPenFont(Font("Liberation Serif", 30)) setPenColor(ColorMaker.hsl(0, 0.13, 0.31)) val x = ("I don't follow paths, ") write(x) } def pic2 = Picture { setPenColor(ColorMaker.hsl(332, 0.99, 0.47)) val y = ("I CREATE!!") setPenFont(Font("Liberation Sans Narrow", 30)) write(y) } picColCentered(pic2, pic1) } def line() = Picture{ val r = (" ") write(r) } val pic12 = picStackCentered(fg, flur) //drawCentered(pic12) //val lineword = picColCentered(words, line) val picwordfg = picColCentered(words, pic12) //draw(picwordfg) val fgbg = picStackCentered(bg, picwordfg) drawCentered(fgbg)





Your Comment:





Login to post a comment