       (defun spacemacs/state-color-face (state)
         "Return the symbol of the face for the given STATE."
         (intern (format "spacemacs-%s-face" (symbol-name state))))
-
-      (defun spacemacs/defface-state-color (state color)
-        "Define a face for the given STATE and background COLOR."
-        (eval `(defface ,(spacemacs/state-color-face state) '((t ()))
-                 ,(format "%s state face." (symbol-name state))
-                 :group 'spacemacs))
-        (set-face-attribute (spacemacs/state-color-face state) nil
-                            :background color
-                            :foreground (face-background 'mode-line)
-                            :box (face-attribute 'mode-line :box)
-                            :inherit 'mode-line))
 
       (defun spacemacs/state-color (state)
         "Return the color string associated to STATE."

  (use-package evil
    :init
    (progn
      (defvar spacemacs-evil-cursor-colors '((normal . "DarkGoldenrod2")
                                             (insert . "chartreuse3")
                                             (emacs  . "SkyBlue2")
                                             (replace . "chocolate")
                                             (evilified . "LightGoldenrod3")
                                             (visual . "gray")
                                             (motion . "plum3")
                                             (lisp   . "HotPink1")
                                             (iedit  . "firebrick1")
                                             (iedit-insert  . "firebrick1"))
        "Colors assigned to evil states.")

      ;; put back refresh of the cursor on post-command-hook see status of:
      ;; https://bitbucket.org/lyro/evil/issue/502/cursor-is-not-refreshed-in-some-cases

    :commands hybrid-mode
    :init
    (progn
      ;; (add-to-list 'spacemacs-evil-cursors
      ;;              `("hybrid"  ,(spacemacs/state-color 'emacs) (bar . 2)))
      (defface spacemacs-hybrid-face
        `((t (:background ,(spacemacs/state-color 'emacs)
             :foreground ,(face-background 'mode-line)
             :box ,(face-attribute 'mode-line :box)
             :inherit 'mode-line)))
        "Hybrid state face."
        :group 'spacemacs)
      (setq hybrid-mode-insert-state-cursor
            (if (and (display-graphic-p)
                     dotspacemacs-colorize-cursor-according-to-state)
