         (.setColor closure-comp (:color/hex active-color)))))
 
   (render [this]
-    (let [{:keys [palette-widget/closure-comp palette-widget/active-color] :as props} (om/props this)]
-      (dom/div #js {:onMouseUp #(color-update this {:color/id (:color/id active-color)
-                                                    :color/hex (.getColor closure-comp)})
-                    ;;:onTouchEnd #(color-update this (.getColor closure-comp))
+    (let [{:keys [palette-widget/closure-comp
+                  palette-widget/active-color] :as props} (om/props this)]
+      (dom/div #js {:onMouseUp #(color-update this active-color closure-comp)
+                    ;;:onTouchEnd #(color-update this active-color closure-comp)
                     :ref "paletteWidget"} nil))))
 
 (def palette-widget (om/factory PaletteWidget))

(declare Palette)
(declare PaletteWidget)

(defn color-update [comp props]
  (om/transact! comp
    `[(color/update ~props) :palette]))

(defn color-remove [comp {:keys [color/id] :as color}]
  (om/transact! comp
    `[(color/remove) :palette]))

(defn colorize-faces [classes color-prop hex-temp]
  (when-not (empty? classes)

      (forEach elements #(setStyle % color-prop hex-temp)))))

(defn selectors-for-colorize [faces color-type]
  (let [selectors (map #(face-to-selectors % color-type) faces)]
    (if (= 1 (count faces))
      (first selectors)
      (reduce #(vector
                 (str (first %1) "," (first %2))
                 (str (last %1) "," (last %2)))
        selectors))))

(defn color-class [props]
  (let [{:keys [:color/id :color/hex :palette-widget/active-color]} props
        active? (= id (:color/id active-color))]
    (str "color color-editable"
      (when active? " color-active")
      (when-not hex " color-missing")
      " color-" id)))

(defui Color
  static om/Ident
