Skip to content

Instantly share code, notes, and snippets.

@cieloazul310
Created September 1, 2020 01:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cieloazul310/95848cc3ffcd03f9b97e705b26688acc to your computer and use it in GitHub Desktop.
Save cieloazul310/95848cc3ffcd03f9b97e705b26688acc to your computer and use it in GitHub Desktop.
(def w 20)
(def h (/ w 2))
(def items 4)
(def size (* w items))
(def r (/ w (sqrt 3)))
(def cyan "#00FFFF")
(def magenta "#FF00FF")
(def yellow "#FFFF00")
(def black "#000000")
(defn color [i]
(case (mod i 4)
0 cyan
1 magenta
2 yellow
3 black
)
)
(defn hoge [x y i] (transform
(mat2d/*
(translate [
(if (even? (floor (/ i (+ items 1)))) x (+ x h))
y
])
)
(style (fill (color i))
(circle [0 0] 1)
)
))
(def canvas (rect [0 0 size size]))
(artboard
{:bounds [0 0 size size]
:background "#fff"}
(for [y (column 0 items w) x (column 0 items w) :index i]
(hoge x y i)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment