                         (doseq [x (range (count "Rainbow"))
                                 :let [rgb (hsv->rgb (double (rand 360)) 1.0 1.0)]]
                             (zat/set-fx-fg! terminal :rainbow (inc x) 1 rgb)))
-                        (zat/assoc-fx-uniform! terminal "time" (swap! time inc))
                         (zat/refresh! terminal)
                       (Thread/sleep 10)
                       (recur))


(defn -main [& _]
  ;; render in background thread
   (let [colorShift    (atom 0.0001)
         brightness    (atom 0.68)
         contrast      (atom 2.46)
         scanlineDepth (atom 0.94)
         time          (atom 0.0)
         noise         (atom 0.0016)
         terminal   (zgl/make-terminal [:text :rainbow]
                                       {:title "Zaffre demo"
                                        :columns 80 :rows 24
                                        :default-fg-color [250 250 250]
                                        :default-bg-color [5 5 8]
                                        :windows-font (TTFFont. "Consolas" 12)
                                        ;:else-font "/home/santos/Downloads/cour.ttf"
                                        ;:else-font (TTFFont. "/home/santos/Downloads/cour.ttf" 12)
                                        ;:else-font (TTFFont. "Monospaced" 12)
                                        ;:else-font (TTFFont. "/home/santos/src/robinson/fonts/Boxy/Boxy.ttf" 12)
                                        ;:else-font (CP437Font. "http://dwarffortresswiki.org/images/2/29/Potash_8x8.png" :green 2)
                                        ;:else-font (CP437Font. "http://dwarffortresswiki.org/images/2/29/Potash_8x8.png" :green 2)
                                        ;:else-font (CP437Font. "http://dwarffortresswiki.org/images/b/b7/Kein_400x125.png" :green 2)
                                        ;:else-font (CP437Font. "http://dwarffortresswiki.org/images/0/03/Alloy_curses_12x12.png" :green 2)
                                        :else-font (CP437Font. "http://dwarffortresswiki.org/images/b/be/Pastiche_8x8.png" :green 1)
                                        ;:else-font (CP437Font. "/home/santos/Pictures/LN_EGA8x8.png" :green 2)
                                        :antialias true
                                        ;:fullscreen true
                                        :icon-paths ["images/icon-16x16.png"
                                                     "images/icon-32x32.png"
                                                     "images/icon-128x128.png"]
                                        :fx-shader {:name     "retro.fs"
                                                    :uniforms [["time" @time]
                                                               ["noise" @noise]
                                                               ["colorShift" @colorShift]
                                                               ["scanlineDepth" @scanlineDepth]
                                                               ["brightness" @brightness]
                                                               ["contrast" @contrast]]}})
        fullscreen-sizes (zat/fullscreen-sizes terminal)
        last-key    (atom nil)
        ;; Every 10ms, set the "Rainbow" text to have a random fg color
        fx-chan     (go-loop []

        (log/info "got key" (or (str @last-key) "nil"))
        ;; change font size on s/m/l keypress
        (case new-key
          \q (zat/destroy! terminal)
          nil)
        (if (= new-key :exit)
