From 7e37c8136654a8b1c865eaf3d558e3d1b3010b5b Mon Sep 17 00:00:00 2001 From: Keith Russell Date: Sat, 3 Feb 2018 22:46:13 -0500 Subject: [PATCH] Add option for mode line highlighting to use contrasting colors. This change adds an option to the mode line highlighting to use contrasting colors to indicate the active mode line rather than using a box. The readme has also been updated to include the new options. --- README.org | 5 +++++ base16-theme.el | 22 +++++++++++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/README.org b/README.org index 12b90ba..26936ba 100644 --- a/README.org +++ b/README.org @@ -59,6 +59,11 @@ themes. Note that they need to be set before load-theme is called. different from the normal background color. Also affects `linum-mode' background. Defaults to true. +=base16-highlight-mode-line= - Make the active mode line stand out +more. There are two choices for applying the emphasis: "box" draws a +thin border around the active mode line; and "contrast" uses the +default face's foreground which should result in more contrast. +Defaults to off (no special emphasis)." ** Previews Theme previews can be found [[https://belak.github.io/base16-emacs/][here]]. diff --git a/base16-theme.el b/base16-theme.el index 64925cb..d25be05 100644 --- a/base16-theme.el +++ b/base16-theme.el @@ -35,9 +35,16 @@ Also affects `linum-mode' background." :group 'base16) (defcustom base16-highlight-mode-line nil - "Make the active mode line stand out more by drawing a thin -border around it." - :type 'boolean + "Make the active mode line stand out more. + +There are two choices for applying the emphasis: + box: Draws a thin border around the active + mode line. + contrast: Use the \"default\" face's foreground + which should result in more contrast." + :type '(choice (const :tag "Off" nil) + (const :tag "Draw box around" box) + (const :tag "Contrast" contrast)) :group 'base16) (defvar base16-shell-colors @@ -103,10 +110,15 @@ return the actual color value. Otherwise return the value unchanged." (plist-get colors :base00))) ((string= (symbol-name key) "base16-settings-mode-line-box") - (if base16-highlight-mode-line + (if (eq base16-highlight-mode-line 'box) (list :line-width 1 :color (plist-get colors :base04)) nil)) + ((string= (symbol-name key) "base16-settings-mode-line-fg") + (if (eq base16-highlight-mode-line 'contrast) + (plist-get colors :base05) + (plist-get colors :base04))) + (t (let ((maybe-color (plist-get colors (intern (concat ":" (symbol-name key)))))) (if maybe-color @@ -232,7 +244,7 @@ return the actual color value. Otherwise return the value unchanged." (line-number-current-line :inverse-video t) ;;;; mode-line - (mode-line :foreground base04 :background base02 :box base16-settings-mode-line-box) + (mode-line :foreground base16-settings-mode-line-fg :background base02 :box base16-settings-mode-line-box) (mode-line-buffer-id :foreground base0B :background nil) (mode-line-emphasis :foreground base06 :slant italic) (mode-line-highlight :foreground base0E :box nil :weight bold)