 (def black {:r 0 :g 0 :b 0})
 (def white {:r 1 :g 1 :b 1})
 
-(def leds (take 5 (repeat black)))
+(def leds (take 36 (repeat black)))
+
+(defn constrain
+  [start end n]
+  (min end (max start n)))
 
 (defn static-color [color]
   (fn [env leds]

           leds factors))))

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

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

(def renderer (:renderer started-system))

(def displayer (:displayer started-system))

