         hit-ctx (:context (get-by-id hit-stage))
         color (pixel-color hit-ctx x y)
         color-map-config (get @color-map color)]
-    (cond (= event-type :mousemove)
+    (cond (= event-type :mouseup)
           (do (.log js/console (str ":mousemove"))
-            (.log js/console (str "color:" color))))
+            (.log js/console (str "color:" color))
+            (.log js/console (str "alpha:" (.-globalAlpha hit-ctx)))
+            (.log js/console (str "x:" x " y:" y))))
     (cond (not(nil? color-map-config))
           (let [f (get color-map-config event-type)]
             (cond (not (nil? f))


(def color-generator (color-hash))

(defn draw-stage [config]
  (let [ {:keys [id width height]} config e (.createElement js/document "canvas") hit-stage-id (build-name id)]
    (set! (.-id e) hit-stage-id)
    (set! (.-width e) width)
    (set! (.-height e) height)
    (let [ctx (.getContext e "2d")]
      (swap! shape/entities conj (assoc config :type "stage" :ref e :context ctx :id hit-stage-id :parent id)))))

(defn render-shape [ctx config]
   (let [color (color-generator)
          hit-config (assoc config :strokeStyle color :fillStyle color)
         hit-context (get-hit-context config)]
      (swap! color-map assoc color config)
      ((:renderer config) hit-context hit-config)))

(defn intersects
  "Tests for intersection using the colormap"

  (let [ hex (.toString s 16)]
    (str (.substr "00" 0, (- 2 (.-length hex))) hex)))

(defn from-hex [s]
  (let [r (subs s 1 3) g (subs s 3 5) b (subs s 5 7)]
    [(js/parseInt r 16) (js/parseInt g 16) (js/parseInt b 16)]))

(defn color-hash []
   (let [r (atom 1) g (atom 0) b (atom 0)]
      (fn []
