 (defn pulse
   [color]
   "Creates a pulse mode starting at the given color/hsv"
-  (PulseMode. color 1.0 (/ 6.0 100000) 0))
+  (PulseMode. color 1.0 (/ 6.0 100000.0) 0))

        h (mod (* t deg-per-ms) 360)]
    (color/hsv* h 1.0 v)))

(defrecord PulseMode
  [colors alpha deg-per-ms accum-time]



  (update
   [this event]
    (case [(:type event) (:button event)]
      [:time/tick nil]
      (assoc this 
        :accum-time
        (+ (:accum-time this) (:elapsed event))
        :colors
        (generate-color (:accum-time this) alpha deg-per-ms))

      [:button/repeat :x-axis]
      (let [delta (* (or (:value event) 0)
                     (or (:elapsed event) 0)
                     adjustment-rate)
            new-rate (-> deg-per-ms (+ delta) (min max-rate) (max min-rate))]
        (assoc this :deg-per-ms new-rate))
      this))

  (render
   [this pixel]
