Skip to content

Commit

Permalink
Merge pull request #69 from keithrussell42/topic/mode-line-choice
Browse files Browse the repository at this point in the history
Add option for mode line highlighting to use contrasting colors.
  • Loading branch information
belak authored Feb 6, 2018
2 parents 45b07ea + 7e37c81 commit 10180e8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
5 changes: 5 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -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]].
Expand Down
22 changes: 17 additions & 5 deletions base16-theme.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 10180e8

Please # to comment.