    (fn []
      (let [st      @state
            new-id  (new-color-id (:colors/list st))
-           state'  (update-in st [:colors/by-id] merge {new-id {:color/id new-id}})
+           state'  (update st :colors/by-id merge {new-id {:color/id new-id}})
            state'' (update state' :colors/list conj [:colors/by-id new-id])]
        (reset! state state'')))})
 

  {:action
   (fn []
     (reset! state (-> @state
                     (update-in [:colors/by-id] dissoc (last ref))
                     (update-in [:colors/list] #(filterv (partial not= ref) %)))))})

(defmethod mutate 'color/update
  [{:keys [state]} _ {:keys [id rgb] :as props}]
  {:value {:keys [:faces/list]}
   :action
   (fn []
     (swap! state update-in [:colors/by-id id] assoc :color/rgb rgb))})

(defmethod mutate 'face/update
  [{:keys [state]} _ {:keys [:face/name] :as props}]

  [{:keys [state]} _ {:keys [new-name prev-name]}]
  {:action
   (fn []
     (reset! state (-> @state
                     (assoc :theme/name new-name :theme/name-temp nil)
                     (update :theme/map clojure.set/rename-keys {prev-name new-name}))))})

(defn current-theme [state]
  "Extracts current theme data from the current state"
