 (def stop-active-color
   "The color of the stop button when active."
   (colors/create-color :red))
+
+(def click-unsynced-beat-color
+  "The color of the tap tempo button when a beat is taking place."
+  (colors/create-color :blue))
+
+(def click-unsynced-off-beat-color
+  "The color of the tap tempo button when a beat is not taking place."
+  (colors/darken click-unsynced-beat-color 45))
+
+(def click-synced-beat-color
+  "The color of the tap tempo button when a beat is taking place."
+  (colors/create-color :green))
+
+(def click-synced-off-beat-color
+  "The color of the tap tempo button when a beat is not taking place."
+  (colors/darken click-synced-beat-color 45))
 
 (defn led-color-values
   "Given a color, return the values that should be sent in a Sysex

  (when (not= marker @(:last-marker controller))
    (reset! (:last-marker controller) marker)))

(defn- update-interface
  "Determine the desired current state of the interface, and send any
  changes needed to get it to that state."

(defn- interpret-tempo-tap
  "React appropriately to a tempo tap, based on the sync mode of the
  show metronome. If it is manual, invoke the metronome tap-tempo
  handler. If MIDI, align the current beat to the tap. If DJ Link or
  Traktor Beat phase (so beats are already automatically aligned), set
  the current beat to be a down beat (first beat of a bar). If the
  shift key is held down, synchronize at the next higher level."
  [controller]
  (with-show (:show controller)
    (let [metronome  (get-in controller [:show :metronome])
          base-level (:level (show/sync-status))
          level      (if @(:shift-mode controller)
                       (case base-level
                         nil   :bpm
                         :bpm  :beat
                         :beat :bar
                         :bar  :phrase
                         base-level)
                       base-level)]
      (case level
        nil   ((:tap-tempo-handler controller))
        :bpm  (rhythm/metro-beat-phase metronome 0)
        :beat (rhythm/metro-bar-start metronome (rhythm/metro-bar metronome))
        :bar  (rhythm/metro-phrase-start metronome (rhythm/metro-phrase metronome))
        (warn "Don't know how to tap tempo for sync type" level)))))



(defn- leave-user-mode
  "The user has asked to exit user mode, so suspend our display
