diff --git a/README.md b/README.md index 1731d14..4e72d65 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,7 @@ but does include several variables that can be customized. variable name default optional -------------------------------------------- + solarized-termcolors = 16 | 256 solarized-degrade = nil | t solarized-bold = t | nil solarized-underline = t | nil @@ -94,6 +95,19 @@ but does include several variables that can be customized. ### Option Details +* solarized-termcolors + + Some 256-color terminals also allow you to set and use the standard 16 + colors in addition to the fixed 256-color palette. This option only + applies when your terminal is in 256-color mode. If set to 16 (the + default) it will try to use the exact Solarized colors (assuming that + you've set these colors to the correct Solarized values either manually or + by importing one of the many colorscheme available for popular + terminal emulators). If it’s set to 256, then Solarized will use a + degraded version of the Solarized palette by displaying the closest colors + in the terminal's default 256 colors as shown in [Xterm's color + chart](http://en.wikipedia.org/wiki/File:Xterm_color_chart.png). + * solarized-degrade For test purposes only; in GUI mode, this forces Solarized to use the 256 diff --git a/solarized-definitions.el b/solarized-definitions.el index 70e62da..2fb32ab 100644 --- a/solarized-definitions.el +++ b/solarized-definitions.el @@ -5,6 +5,15 @@ "Color theme by Ethan Schoonover, created 2011-03-24. Ported to Emacs by Greg Pfeil, http://ethanschoonover.com/solarized.") +(defcustom solarized-termcolors 16 + "This is set to 16 by default, meaning that Solarized will attempt to use the +standard 16 colors of your terminal emulator. You will need to set those colors +to the correct Solarized values either manually or by importing one of the many +colorscheme available for popular terminal emulators and Xdefaults." + :type 'integer + :options '(16 256) + :group 'solarized) + (defcustom solarized-degrade nil "For test purposes only; when in GUI mode, forces Solarized to use the 256 degraded color mode to test the approximate color values for accuracy." @@ -124,7 +133,8 @@ the \"Gen RGB\" column in solarized-definitions.el to improve them further." (solarized-broken-srgb 2) (t 1)))) (((background dark) (type tty) (min-colors 256)) - ,(solarized-face-for-index facespec 3)) + ,(solarized-face-for-index facespec + (if (= solarized-termcolors 16) 4 3))) (((background dark) (type tty) (min-colors 16)) ,(solarized-face-for-index facespec 4)) (((background dark) (type tty) (min-colors 8)) @@ -136,7 +146,9 @@ the \"Gen RGB\" column in solarized-definitions.el to improve them further." (t 1)) t)) (((background light) (type tty) (min-colors 256)) - ,(solarized-face-for-index facespec 3 t)) + ,(solarized-face-for-index facespec + (if (= solarized-termcolors 16) 4 3) + t)) (((background light) (type tty) (min-colors 16)) ,(solarized-face-for-index facespec 4 t)) (((background light) (type tty) (min-colors 8))