Created
September 12, 2017 13:18
-
-
Save litan/a13954f644897d3bde83e3a59b0433dc to your computer and use it in GitHub Desktop.
A ‘shape’ drawing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shape.clear() | |
def r(w: Int, h: Int) = Shape.rectangle(w, h) .outlined(black) | |
def sq(l: Int) = r(l, l) | |
def vgap(l: Int) = Shape.gap(0, l) | |
def hgap(l: Int) = Shape.gap(l, 0) | |
val eyes = sq(50) beside hgap(100) beside sq(50) filled(lightGray) | |
val nose = r(30, 100) .filled(orange) | |
val mouth = r(100, 20) .filled(red) | |
val face = eyes above | |
vgap(10) above | |
nose above | |
vgap(30) above | |
mouth on | |
sq(350) | |
Shape.draw(face) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment