Add the solarized-contrast custom variable.
As requested in issue #32. I hadn’t added it previously, due to the description attached to it: “Stick with normal! It's been carefully tested. Setting this option to high or low does use the same Solarized palette but simply shifts some values up or down in order to expand or compress the tonal range displayed.”
This commit is contained in:
parent
26260c07e2
commit
cfa6d87355
|
@ -6,8 +6,8 @@
|
|||
Ported to Emacs by Greg Pfeil, http://ethanschoonover.com/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."
|
||||
"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."
|
||||
:type 'boolean
|
||||
:group 'solarized)
|
||||
|
||||
|
@ -28,11 +28,20 @@ to test the approximate color values for accuracy."
|
|||
|
||||
(defcustom solarized-termcolors 16
|
||||
"This setting applies to emacs in terminal (non-GUI) mode.
|
||||
If set to 16, emacs will use the terminal emulator's colorscheme
|
||||
(best option as long as you've set your emulator's colors to the Solarized palette).
|
||||
If set to 256 and your terminal is capable of displaying 256 colors, emacs
|
||||
will use the 256 degraded color mode."
|
||||
If set to 16, emacs will use the terminal emulator's colorscheme (best option as
|
||||
long as you've set your emulator's colors to the Solarized palette). If set to
|
||||
256 and your terminal is capable of displaying 256 colors, emacs will use the
|
||||
256 degraded color mode."
|
||||
:type 'integer
|
||||
:options '(16 256)
|
||||
:group 'solarized)
|
||||
|
||||
(defcustom solarized-contrast 'normal
|
||||
"Stick with normal! It's been carefully tested. Setting this option to high or
|
||||
low does use the same Solarized palette but simply shifts some values up or down
|
||||
in order to expand or compress the tonal range displayed."
|
||||
:type 'symbol
|
||||
:options '(high normal low)
|
||||
:group 'solarized)
|
||||
|
||||
;; FIXME: The Generic RGB colors will actually vary from device to device, but
|
||||
|
@ -88,14 +97,23 @@ will use the 256 degraded color mode."
|
|||
(green (find-color 'green))
|
||||
(bold (if solarized-bold 'bold 'normal))
|
||||
(underline (if solarized-underline t nil))
|
||||
(opt-under nil)
|
||||
(italic (if solarized-italic 'italic 'normal)))
|
||||
(when (eq 'light mode)
|
||||
(rotatef base03 base3)
|
||||
(rotatef base02 base2)
|
||||
(rotatef base01 base1)
|
||||
(rotatef base00 base0))
|
||||
(let ((back base03))
|
||||
(cond ((eq 'high solarized-contrast)
|
||||
(let ((orig-base3 base3))
|
||||
(rotatef base01 base00 base0 base1 base2 base3)
|
||||
(setf base3 orig-base3)))
|
||||
((eq 'low solarized-contrast)
|
||||
(setf back base02
|
||||
opt-under t)))
|
||||
`((;; basic
|
||||
(default ((t (:foreground ,base0 ,:background ,base03))))
|
||||
(default ((t (:foreground ,base0 ,:background ,back))))
|
||||
(cursor
|
||||
((t (:foreground ,base0 :background ,base03 :inverse-video t))))
|
||||
(escape-glyph-face ((t (:foreground ,red))))
|
||||
|
@ -130,7 +148,8 @@ will use the 256 degraded color mode."
|
|||
(custom-button
|
||||
((t (:background ,base02
|
||||
:box (:line-width 2 :style released-button)))))
|
||||
(custom-button-mouse ((t (:inherit custom-button :foreground ,base1))))
|
||||
(custom-button-mouse
|
||||
((t (:inherit custom-button :foreground ,base1))))
|
||||
(custom-button-pressed
|
||||
((t (:inherit custom-button-mouse
|
||||
:box (:line-width 2 :style pressed-button)))))
|
||||
|
@ -156,7 +175,8 @@ will use the 256 degraded color mode."
|
|||
;; emacs-wiki
|
||||
(emacs-wiki-bad-link-face
|
||||
((t (:foreground ,red :underline ,underline))))
|
||||
(emacs-wiki-link-face ((t (:foreground ,blue :underline ,underline))))
|
||||
(emacs-wiki-link-face
|
||||
((t (:foreground ,blue :underline ,underline))))
|
||||
(emacs-wiki-verbatim-face
|
||||
((t (:foreground ,base00 :underline ,underline))))
|
||||
;; font-lock
|
||||
|
@ -193,15 +213,21 @@ will use the 256 degraded color mode."
|
|||
(org-done ((t (:foreground ,green :weight ,bold))))
|
||||
(org-todo-kwd-face ((t (:foreground ,red :background ,base03))))
|
||||
(org-done-kwd-face ((t (:foreground ,green :background ,base03))))
|
||||
(org-project-kwd-face ((t (:foreground ,violet :background ,base03))))
|
||||
(org-waiting-kwd-face ((t (:foreground ,orange :background ,base03))))
|
||||
(org-project-kwd-face
|
||||
((t (:foreground ,violet :background ,base03))))
|
||||
(org-waiting-kwd-face
|
||||
((t (:foreground ,orange :background ,base03))))
|
||||
(org-someday-kwd-face ((t (:foreground ,blue :background ,base03))))
|
||||
(org-started-kwd-face ((t (:foreground ,yellow :background ,base03))))
|
||||
(org-cancelled-kwd-face ((t (:foreground ,green :background ,base03))))
|
||||
(org-delegated-kwd-face ((t (:foreground ,cyan :background ,base03))))
|
||||
(org-started-kwd-face
|
||||
((t (:foreground ,yellow :background ,base03))))
|
||||
(org-cancelled-kwd-face
|
||||
((t (:foreground ,green :background ,base03))))
|
||||
(org-delegated-kwd-face
|
||||
((t (:foreground ,cyan :background ,base03))))
|
||||
;; show-paren
|
||||
(show-paren-match-face ((t (:background ,cyan :foreground ,base3))))
|
||||
(show-paren-mismatch-face ((t (:background ,red :foreground ,base3))))
|
||||
(show-paren-mismatch-face
|
||||
((t (:background ,red :foreground ,base3))))
|
||||
;; widgets
|
||||
(widget-field
|
||||
((t (:box (:line-width 1 :color ,base00) :inherit default))))
|
||||
|
@ -245,12 +271,14 @@ will use the 256 degraded color mode."
|
|||
(gnus-server-offline ((t (:foreground ,green :weight ,bold))))
|
||||
(gnus-server-opened ((t (:foreground ,cyan :weight ,bold))))
|
||||
(gnus-splash ((t (:foreground ,base2))))
|
||||
(gnus-summary-high-ancient ((t (:foreground ,magenta :weight ,bold))))
|
||||
(gnus-summary-high-ancient
|
||||
((t (:foreground ,magenta :weight ,bold))))
|
||||
(gnus-summary-high-read ((t (:foreground ,base1 :weight ,bold))))
|
||||
(gnus-summary-high-ticked ((t (:foreground ,base3 :weight ,bold))))
|
||||
(gnus-summary-high-undownloaded
|
||||
((t (:foreground ,base2 :weight ,bold))))
|
||||
(gnus-summary-low-ancient ((t (:foreground ,magenta :slant ,italic))))
|
||||
(gnus-summary-low-ancient
|
||||
((t (:foreground ,magenta :slant ,italic))))
|
||||
(gnus-summary-low-read ((t (:foreground ,base1 :slant ,italic))))
|
||||
(gnus-summary-low-ticked ((t (:foreground ,base3 :slant ,italic))))
|
||||
(gnus-summary-low-undownloaded
|
||||
|
@ -272,7 +300,8 @@ will use the 256 degraded color mode."
|
|||
(whitespace-tab ((t (:foreground ,base02))))
|
||||
(whitespace-trailing
|
||||
((t (:background ,base02 :foreground ,red :weight ,bold))))
|
||||
(whitespace-highlight-face ((t (:background ,blue :foreground ,red))))
|
||||
(whitespace-highlight-face
|
||||
((t (:background ,blue :foreground ,red))))
|
||||
;; Message
|
||||
(message-mml ((t (:foreground ,blue))))
|
||||
(message-cited-text ((t (:foreground ,base2))))
|
||||
|
@ -288,7 +317,7 @@ will use the 256 degraded color mode."
|
|||
((foreground-color . ,base0)
|
||||
(background-color . ,base03)
|
||||
(background-mode . ,mode)
|
||||
(cursor-color . ,base0))))))
|
||||
(cursor-color . ,base0)))))))
|
||||
|
||||
(defmacro create-solarized-theme (mode)
|
||||
(let* ((theme-name (intern (concat "solarized-" (symbol-name mode))))
|
||||
|
|
Loading…
Reference in New Issue