                         (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))

                          ;; ~30fps
                        (Thread/sleep 33)
                        (recur))]
    (log/info "Fullscreen sizes" fullscreen-sizes)
    ;; get key presses in fg thread
    (loop []
      (let [new-key (async/<!! (zat/get-key-chan terminal))]


(defn -main [& _]
  ;; render in background thread
   (let [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 (TTFFont. "Monospaced" 12)
                                        :icon-paths ["images/icon-16x16.png"
                                                     "images/icon-32x32.png"
                                                     "images/icon-128x128.png"]})
        last-key    (atom nil)
        ;; Every 10ms, set the "Rainbow" text to have a random fg color
        fx-chan     (go-loop []
