 (def renderer (:renderer started-system))
 
 (def displayer (:displayer started-system))
+

(def black {:r 0 :g 0 :b 0})
(def white {:r 1 :g 1 :b 1})

(def leds (take 5 (repeat black)))

(defn static-color [color]
  (fn [env leds]

           leds factors))))

(defn pulse-brightness [{:keys [time] :as env} leds]
  (let [scaled-time (* 2 Math/PI (/ time 1000))
        brightness-factor (+ 1/2
                             (/ (Math/sin scaled-time) 2))]
    (map (fn [led]
           (fmap #(* % brightness-factor) led))
         leds)))

(defn swimming-static-color
  ([color length interval]
   (swimming-static-color color length interval 0))

  ([color length interval initial-offset]
   (fn [{:keys [time] :as env} leds]
     (let [leds (vec leds)
           size (count leds)
           last (dec size)
           offset (+ initial-offset
                     (int (Math/floor (* (inc size)
                                         (/ (mod time interval) interval)))))
           start (constrain 0 last (- offset length))]
       (into [] (concat (subvec leds 0 start)
                        (take (- offset start) (repeat color))
                        (subvec leds (min last offset))))))))

(defn apply-layers [layers env leds]
  (let [env-applied-layers (for [layer layers] (partial layer env))]
