Created
August 22, 2020 14:10
-
-
Save blad/72a8d715251af9c344ffce023794d6ba to your computer and use it in GitHub Desktop.
Ronin: Apply Dot Effect to Imported Image
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
(clear) | |
(open $path .5) | |
(def background "black") | |
(def unit 10) | |
(def padding 1) | |
(def r (sub (div unit 2) padding)) | |
(def f (get-frame)) | |
(defn find-color (p) | |
(pick | |
(rect p:x p:y unit unit))) | |
(defn draw | |
(p) | |
( | |
(def color | |
(find-color p)) | |
(fill | |
(rect p:x p:y unit unit) background) | |
(fill | |
(circle | |
(add p:x r) | |
(add p:y r) r) color))) | |
(defn draw-row | |
(y) | |
(each | |
(range 0 f:w unit) | |
(λ | |
(x) | |
(draw | |
(pos x y))))) | |
(each | |
(range 0 f:h unit) draw-row) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment