 ;; which are included in this repo.
 
 ;;; Code:
+
+(defvar base16-theme-use-shell-colors nil
+  "Enable support for base16-shell.
+
+Because base16-shell mangles the color space, we need to use a
+different color translation.  This needs to be specified manually
+before the themes are loaded.")
 
 (defvar base16-shell-colors
   '(:base00 "black"

    :base0D "blue"
    :base0E "magenta"
    :base0F "brightcyan")
  "Base16 colors used when in a terminal.

These mappings are based on the xresources themes.  If you're
using a different terminal color scheme, you may want to look for
an alternate theme for use in the terminal.")

(defun base16-transform-spec (spec colors)
  "Transform a theme `SPEC' into a face spec using `COLORS'."


(defun base16-transform-face (spec colors)
  "Transform a face `SPEC' into an Emacs theme face definition using `COLORS'."
  (let* ((face         (car spec))
         (definition   (cdr spec))
         (shell-colors (if base16-theme-use-shell-colors base16-shell-colors-256 base16-shell-colors)))

    (list face `((((type graphic)) ,(base16-transform-spec definition colors))
                 (t                ,(base16-transform-spec definition shell-colors))))))

(defun base16-set-faces (theme-name colors faces)
  "Define the important part of `THEME-NAME' using `COLORS' to map the `FACES' to actual colors."
