Skip to content

Instantly share code, notes, and snippets.

@litan
Created September 12, 2017 13:18
Show Gist options
  • Save litan/a13954f644897d3bde83e3a59b0433dc to your computer and use it in GitHub Desktop.
Save litan/a13954f644897d3bde83e3a59b0433dc to your computer and use it in GitHub Desktop.
A ‘shape’ drawing
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