tinted-theming / base16-emacs

Base16 themes for Emacs
MIT License
380 stars 76 forks source link

base16-theme-256-color-source 'colors does not do as expected #76

Closed ElvishJerricco closed 5 years ago

ElvishJerricco commented 5 years ago

Adding (setq base16-theme-256-color-source 'colors) to my emacs has no effect whatsoever, and I still see colors that look nothing like my theme in the GUI mode.

(use-package base16-theme
  :demand
  :config
  (setq base16-theme-256-color-source 'colors)
  (custom-set-variables '(base16-distinct-fringe-background nil))
  (load-theme 'base16-elvishjerricco t))

But applying this patch makes a big difference and looks like a much better 256 color approximation of the theme.

diff --git a/base16-theme.el b/base16-theme.el
index cb65519..f5dec21 100644
--- a/base16-theme.el
+++ b/base16-theme.el
@@ -163,7 +163,7 @@ return the actual color value.  Otherwise return the value unchanged."
     ;; use the base16-shell colors. Otherwise, we fall back to the basic
     ;; xresources colors.
     (list face `((((type graphic))   ,(base16-transform-spec definition colors))
-                 (((min-colors 256)) ,(base16-transform-spec definition shell-colors-256))
+                 (((min-colors 256)) ,(base16-transform-spec definition colors))
                  (t                  ,(base16-transform-spec definition base16-shell-colors))))))

 (defun base16-set-faces (theme-name colors faces)
belak commented 5 years ago

This is because the command should be (setq base16-theme-256-color-source "colors")

You can see in the definition that the type is a string:

(defcustom base16-theme-256-color-source "terminal"
  "Where to get the colors in a 256-color terminal.
In a 256-color terminal, it's not clear where the colors should come from.
There are 3 possible values: terminal (which was taken from the xresources
theme), base16-shell (which was taken from a combination of base16-shell and
the xresources theme) and colors (which will be converted from the actual
html color codes to the closest color).
Note that this needs to be set before themes are loaded or it will not work."
  :type '(string)
  :group 'base16
:options '("terminal" "base16-shell" "colors"))

When I initially wrote this, I hadn't quite figured out symbols... >_< I should fix that at some point.

ElvishJerricco commented 5 years ago

@belak I could've swore I tried that... Worked great, thanks :)

belak commented 5 years ago

Glad that worked!