This adds in @josh's 256-color changes (for some reason, I couldn't manage to pull any changes from the repo). It also rearranges things a bit to keep all the color definitions in a table.

This commit is contained in:
Greg Pfeil 2011-04-15 10:15:57 -04:00
parent c8e9f41c5c
commit c51b75d5f5
1 changed files with 190 additions and 161 deletions

View File

@ -13,171 +13,200 @@
(eval-when-compile (eval-when-compile
(require 'color-theme)) (require 'color-theme))
(defvar color-theme-solarized-colors
;; name ideal 256
'((base03 "#002b36" "#1c1c1c")
(base02 "#073642" "#262626")
(base01 "#586e75" "#4e4e4e")
(base00 "#657b83" "#585858")
(base0 "#839496" "#808080")
(base1 "#93a1a1" "#8a8a8a")
(base2 "#eee8d5" "#d7d7af")
(base3 "#fdf6e3" "#ffffd7")
(yellow "#b58900" "#af8700")
(orange "#cb4b16" "#d75f00")
(red "#dc322f" "#af0000")
(magenta "#d33682" "#af005f")
(violet "#6c71c4" "#5f5faf")
(blue "#268bd2" "#0087ff")
(cyan "#2aa198" "#00afaf")
(green "#859900" "#5f8700"))
"This is a table of all the colors used by the Solarized color theme. Each
column is a different set, one of which will be chosen based on term
capabilities, etc.")
(defun color-theme-solarized (mode) (defun color-theme-solarized (mode)
"Color theme by Ethan Schoonover, created 2011-03-24. "Color theme by Ethan Schoonover, created 2011-03-24.
Ported to Emacs by Greg Pfeil, http://ethanschoonover.com/solarized." Ported to Emacs by Greg Pfeil, http://ethanschoonover.com/solarized."
(interactive "Slight or dark? ") (interactive "Slight or dark? ")
(let ((base03 "#002b36") (flet ((find-color (name)
(base02 "#073642") (let ((index (if (or (<= (display-color-cells) 256)) 2 1)))
(base01 "#586e75") (nth index (assoc name color-theme-solarized-colors)))))
(base00 "#657b83") (let ((base03 (find-color 'base03))
(base0 "#839496") (base02 (find-color 'base02))
(base1 "#93a1a1") (base01 (find-color 'base01))
(base2 "#eee8d5") (base00 (find-color 'base00))
(base3 "#fdf6e3") (base0 (find-color 'base0))
(yellow "#b58900") (base1 (find-color 'base1))
(orange "#cb4b16") (base2 (find-color 'base2))
(red "#dc322f") (base3 (find-color 'base3))
(magenta "#d33682") (yellow (find-color 'yellow))
(violet "#6c71c4") (orange (find-color 'orange))
(blue "#268bd2") (red (find-color 'red))
(cyan "#2aa198") (magenta (find-color 'magenta))
(green "#859900")) (violet (find-color 'violet))
(when (eq 'light mode) (blue (find-color 'blue))
(rotatef base03 base3) (cyan (find-color 'cyan))
(rotatef base02 base2) (green (find-color 'green)))
(rotatef base01 base1) (when (eq 'light mode)
(rotatef base00 base0)) (rotatef base03 base3)
(color-theme-install (rotatef base02 base2)
`(color-theme-solarized (rotatef base01 base1)
((foreground-color . ,base0) (rotatef base00 base0))
(background-color . ,base03) (color-theme-install
(background-mode . ,mode) `(color-theme-solarized
(cursor-color . ,base0)) ((foreground-color . ,base0)
;; basic (background-color . ,base03)
(default ((t (:foreground ,base0)))) (background-mode . ,mode)
(cursor ((t (:foreground ,base0 :background ,base03 :inverse-video t)))) (cursor-color . ,base0))
(escape-glyph-face ((t (:foreground ,red)))) ;; basic
(fringe ((t (:foreground ,base01 :background ,base02)))) (default ((t (:foreground ,base0))))
(header-line ((t (:foreground ,base0 :background ,base2)))) (cursor
(highlight ((t (:background ,base02)))) ((t (:foreground ,base0 :background ,base03 :inverse-video t))))
(isearch ((t (:foreground ,yellow :inverse-video t)))) (escape-glyph-face ((t (:foreground ,red))))
(menu ((t (:foreground ,base0 :background ,base02)))) (fringe ((t (:foreground ,base01 :background ,base02))))
(minibuffer-prompt ((t (:foreground ,blue)))) (header-line ((t (:foreground ,base0 :background ,base2))))
(mode-line (highlight ((t (:background ,base02))))
((t (:foreground ,base1 :background ,base02 (isearch ((t (:foreground ,yellow :inverse-video t))))
:box (:line-width 1 :color ,base1))))) (menu ((t (:foreground ,base0 :background ,base02))))
(mode-line-buffer-id ((t (:foreground ,base1)))) (minibuffer-prompt ((t (:foreground ,blue))))
(mode-line-inactive (mode-line
((t (:foreground ,base0 :background ,base02 ((t (:foreground ,base1 :background ,base02
:box (:line-width 1 :color ,base02))))) :box (:line-width 1 :color ,base1)))))
(region ((t (:background ,base02)))) (mode-line-buffer-id ((t (:foreground ,base1))))
(secondary-selection ((t (:background ,base02)))) (mode-line-inactive
(trailing-whitespace ((t (:foreground ,red :inverse-video t)))) ((t (:foreground ,base0 :background ,base02
(vertical-border ((t (:foreground ,base0)))) :box (:line-width 1 :color ,base02)))))
;; comint (region ((t (:background ,base02))))
(comint-highlight-prompt ((t (:foreground ,blue)))) (secondary-selection ((t (:background ,base02))))
;; compilation (trailing-whitespace ((t (:foreground ,red :inverse-video t))))
(compilation-info ((t (:foreground ,green :bold t)))) (vertical-border ((t (:foreground ,base0))))
(compilation-warning ((t (:foreground ,orange :bold t)))) ;; comint
;; customize (comint-highlight-prompt ((t (:foreground ,blue))))
(custom-button ;; compilation
((t (:background ,base02 :box (:line-width 2 :style released-button))))) (compilation-info ((t (:foreground ,green :bold t))))
(custom-button-mouse ((t (:inherit custom-button :foreground ,base1)))) (compilation-warning ((t (:foreground ,orange :bold t))))
(custom-button-pressed ;; customize
((t (:inherit custom-button-mouse (custom-button
:box (:line-width 2 :style pressed-button))))) ((t (:background ,base02
(custom-comment-tag ((t (:background ,base02)))) :box (:line-width 2 :style released-button)))))
(custom-comment-tag ((t (:background ,base02)))) (custom-button-mouse ((t (:inherit custom-button :foreground ,base1))))
(custom-documentation ((t (:inherit default)))) (custom-button-pressed
(custom-group-tag ((t (:foreground ,orange :bold t)))) ((t (:inherit custom-button-mouse
(custom-link ((t (:foreground ,violet)))) :box (:line-width 2 :style pressed-button)))))
(custom-state ((t (:foreground ,green)))) (custom-comment-tag ((t (:background ,base02))))
(custom-variable-tag ((t (:foreground ,orange :bold t)))) (custom-comment-tag ((t (:background ,base02))))
;; diff (custom-documentation ((t (:inherit default))))
(diff-added ((t (:foreground ,green :inverse-video t)))) (custom-group-tag ((t (:foreground ,orange :bold t))))
(diff-changed ((t (:foreground ,yellow :inverse-video t)))) (custom-link ((t (:foreground ,violet))))
(diff-removed ((t (:foreground ,red :inverse-video t)))) (custom-state ((t (:foreground ,green))))
(diff-header ((t (:background ,base01)))) (custom-variable-tag ((t (:foreground ,orange :bold t))))
(diff-file-header ((t (:background ,base1 :foreground ,base01 :bold t)))) ;; diff
(diff-refine-change ((t (:background ,base1)))) (diff-added ((t (:foreground ,green :inverse-video t))))
;; emacs-wiki (diff-changed ((t (:foreground ,yellow :inverse-video t))))
(emacs-wiki-bad-link-face ((t (:foreground ,red :underline t)))) (diff-removed ((t (:foreground ,red :inverse-video t))))
(emacs-wiki-link-face ((t (:foreground ,blue :underline t)))) (diff-header ((t (:background ,base01))))
(emacs-wiki-verbatim-face ((t (:foreground ,base00 :underline t)))) (diff-file-header
;; font-lock ((t (:background ,base1 :foreground ,base01 :bold t))))
(font-lock-builtin-face ((t (:foreground ,green)))) (diff-refine-change ((t (:background ,base1))))
(font-lock-comment-face ((t (:foreground ,base01 :italic t)))) ;; emacs-wiki
(font-lock-constant-face ((t (:foreground ,cyan)))) (emacs-wiki-bad-link-face ((t (:foreground ,red :underline t))))
(font-lock-function-name-face ((t (:foreground ,blue)))) (emacs-wiki-link-face ((t (:foreground ,blue :underline t))))
(font-lock-keyword-face ((t (:foreground ,green)))) (emacs-wiki-verbatim-face ((t (:foreground ,base00 :underline t))))
(font-lock-string-face ((t (:foreground ,cyan)))) ;; font-lock
(font-lock-type-face ((t (:foreground ,yellow)))) (font-lock-builtin-face ((t (:foreground ,green))))
(font-lock-variable-name-face ((t (:foreground ,blue)))) (font-lock-comment-face ((t (:foreground ,base01 :italic t))))
(font-lock-warning-face ((t (:foreground ,red :bold t)))) (font-lock-constant-face ((t (:foreground ,cyan))))
(font-lock-doc-face ((t (:foreground ,cyan :italic t)))) (font-lock-function-name-face ((t (:foreground ,blue))))
;; info (font-lock-keyword-face ((t (:foreground ,green))))
(info-xref ((t (:foreground ,blue :underline t)))) (font-lock-string-face ((t (:foreground ,cyan))))
(info-xref-visited ((t (:inherit info-xref :foreground ,magenta)))) (font-lock-type-face ((t (:foreground ,yellow))))
;; org (font-lock-variable-name-face ((t (:foreground ,blue))))
(org-hide ((t (:foreground ,base03)))) (font-lock-warning-face ((t (:foreground ,red :bold t))))
(org-todo ((t (:foreground ,red :bold t)))) (font-lock-doc-face ((t (:foreground ,cyan :italic t))))
(org-done ((t (:foreground ,green :bold t)))) ;; info
;; show-paren (info-xref ((t (:foreground ,blue :underline t))))
(show-paren-match-face ((t (:background ,cyan :foreground ,base3)))) (info-xref-visited ((t (:inherit info-xref :foreground ,magenta))))
(show-paren-mismatch-face ((t (:background ,red :foreground ,base3)))) ;; org
;; extra modules (org-hide ((t (:foreground ,base03))))
;; ------------- (org-todo ((t (:foreground ,red :bold t))))
;; gnus (org-done ((t (:foreground ,green :bold t))))
(gnus-cite-1 ((t (:foreground ,magenta)))) ;; show-paren
(gnus-cite-2 ((t (:foreground ,base2)))) (show-paren-match-face ((t (:background ,cyan :foreground ,base3))))
(gnus-cite-3 ((t (:foreground ,base3)))) (show-paren-mismatch-face ((t (:background ,red :foreground ,base3))))
(gnus-cite-4 ((t (:foreground ,base1)))) ;; extra modules
(gnus-cite-5 ((t (:foreground ,magenta)))) ;; -------------
(gnus-cite-6 ((t (:foreground ,base2)))) ;; gnus
(gnus-cite-7 ((t (:foreground ,base3)))) (gnus-cite-1 ((t (:foreground ,magenta))))
(gnus-cite-8 ((t (:foreground ,base1)))) (gnus-cite-2 ((t (:foreground ,base2))))
(gnus-cite-9 ((t (:foreground ,base2)))) (gnus-cite-3 ((t (:foreground ,base3))))
(gnus-cite-10 ((t (:foreground ,base3)))) (gnus-cite-4 ((t (:foreground ,base1))))
(gnus-cite-11 ((t (:foreground ,blue)))) (gnus-cite-5 ((t (:foreground ,magenta))))
(gnus-group-mail-1 ((t (:foreground ,base3 :bold t)))) (gnus-cite-6 ((t (:foreground ,base2))))
(gnus-group-mail-1-empty ((t (:foreground ,base3)))) (gnus-cite-7 ((t (:foreground ,base3))))
(gnus-group-mail-2 ((t (:foreground ,base2 :bold t)))) (gnus-cite-8 ((t (:foreground ,base1))))
(gnus-group-mail-2-empty ((t (:foreground ,base2)))) (gnus-cite-9 ((t (:foreground ,base2))))
(gnus-group-mail-3 ((t (:foreground ,magenta :bold t)))) (gnus-cite-10 ((t (:foreground ,base3))))
(gnus-group-mail-3-empty ((t (:foreground ,magenta)))) (gnus-cite-11 ((t (:foreground ,blue))))
(gnus-group-mail-low ((t (:foreground ,base00 :bold t)))) (gnus-group-mail-1 ((t (:foreground ,base3 :bold t))))
(gnus-group-mail-low-empty ((t (:foreground ,base00)))) (gnus-group-mail-1-empty ((t (:foreground ,base3))))
(gnus-group-news-1 ((t (:foreground ,base1 :bold t)))) (gnus-group-mail-2 ((t (:foreground ,base2 :bold t))))
(gnus-group-news-1-empty ((t (:foreground ,base1)))) (gnus-group-mail-2-empty ((t (:foreground ,base2))))
(gnus-group-news-2 ((t (:foreground ,blue :bold t)))) (gnus-group-mail-3 ((t (:foreground ,magenta :bold t))))
(gnus-group-news-2-empty ((t (:foreground ,blue)))) (gnus-group-mail-3-empty ((t (:foreground ,magenta))))
(gnus-group-news-low ((t (:foreground ,violet :bold t)))) (gnus-group-mail-low ((t (:foreground ,base00 :bold t))))
(gnus-group-news-low-empty ((t (:foreground ,violet)))) (gnus-group-mail-low-empty ((t (:foreground ,base00))))
(gnus-header-content ((t (:foreground ,cyan :italic t)))) (gnus-group-news-1 ((t (:foreground ,base1 :bold t))))
(gnus-header-from ((t (:foreground ,base2)))) (gnus-group-news-1-empty ((t (:foreground ,base1))))
(gnus-header-name ((t (:foreground ,blue)))) (gnus-group-news-2 ((t (:foreground ,blue :bold t))))
(gnus-header-newsgroups ((t (:foreground ,green :italic t)))) (gnus-group-news-2-empty ((t (:foreground ,blue))))
(gnus-header-subject ((t (:foreground ,base1)))) (gnus-group-news-low ((t (:foreground ,violet :bold t))))
(gnus-server-agent ((t (:foreground ,base3 :bold t)))) (gnus-group-news-low-empty ((t (:foreground ,violet))))
(gnus-server-closed ((t (:foreground ,base1 :italic t)))) (gnus-header-content ((t (:foreground ,cyan :italic t))))
(gnus-server-denied ((t (:foreground ,base2 :bold t)))) (gnus-header-from ((t (:foreground ,base2))))
(gnus-server-offline ((t (:foreground ,green :bold t)))) (gnus-header-name ((t (:foreground ,blue))))
(gnus-server-opened ((t (:foreground ,cyan :bold t)))) (gnus-header-newsgroups ((t (:foreground ,green :italic t))))
(gnus-splash ((t (:foreground ,base2)))) (gnus-header-subject ((t (:foreground ,base1))))
(gnus-summary-high-ancient ((t (:foreground ,magenta :bold t)))) (gnus-server-agent ((t (:foreground ,base3 :bold t))))
(gnus-summary-high-read ((t (:foreground ,base1 :bold t)))) (gnus-server-closed ((t (:foreground ,base1 :italic t))))
(gnus-summary-high-ticked ((t (:foreground ,base3 :bold t)))) (gnus-server-denied ((t (:foreground ,base2 :bold t))))
(gnus-summary-high-undownloaded ((t (:foreground ,base2 :bold t)))) (gnus-server-offline ((t (:foreground ,green :bold t))))
(gnus-summary-low-ancient ((t (:foreground ,magenta :italic t)))) (gnus-server-opened ((t (:foreground ,cyan :bold t))))
(gnus-summary-low-read ((t (:foreground ,base1 :italic t)))) (gnus-splash ((t (:foreground ,base2))))
(gnus-summary-low-ticked ((t (:foreground ,base3 :italic t)))) (gnus-summary-high-ancient ((t (:foreground ,magenta :bold t))))
(gnus-summary-low-undownloaded ((t (:foreground ,base2 :italic t)))) (gnus-summary-high-read ((t (:foreground ,base1 :bold t))))
(gnus-summary-normal-ancient ((t (:foreground ,magenta)))) (gnus-summary-high-ticked ((t (:foreground ,base3 :bold t))))
(gnus-summary-normal-read ((t (:foreground ,base1)))) (gnus-summary-high-undownloaded ((t (:foreground ,base2 :bold t))))
(gnus-summary-normal-ticked ((t (:foreground ,base3)))) (gnus-summary-low-ancient ((t (:foreground ,magenta :italic t))))
(gnus-summary-normal-undownloaded ((t (:foreground ,base2)))) (gnus-summary-low-read ((t (:foreground ,base1 :italic t))))
;; Message (gnus-summary-low-ticked ((t (:foreground ,base3 :italic t))))
(message-mml ((t (:foreground ,blue)))) (gnus-summary-low-undownloaded ((t (:foreground ,base2 :italic t))))
(message-cited-text ((t (:foreground ,base2)))) (gnus-summary-normal-ancient ((t (:foreground ,magenta))))
(message-separator ((t (:foreground ,base3)))) (gnus-summary-normal-read ((t (:foreground ,base1))))
(message-header-xheader ((t (:foreground ,violet)))) (gnus-summary-normal-ticked ((t (:foreground ,base3))))
(message-header-name ((t (:foreground ,cyan)))) (gnus-summary-normal-undownloaded ((t (:foreground ,base2))))
(message-header-other ((t (:foreground ,red)))) ;; Message
(message-header-newsgroups ((t (:foreground ,yellow :bold t :italic t)))) (message-mml ((t (:foreground ,blue))))
(message-header-subject ((t (:foreground ,base00)))) (message-cited-text ((t (:foreground ,base2))))
(message-header-cc ((t (:foreground ,green :bold t)))) (message-separator ((t (:foreground ,base3))))
(message-header-to ((t (:foreground ,base1 :bold t)))))))) (message-header-xheader ((t (:foreground ,violet))))
(message-header-name ((t (:foreground ,cyan))))
(message-header-other ((t (:foreground ,red))))
(message-header-newsgroups
((t (:foreground ,yellow :bold t :italic t))))
(message-header-subject ((t (:foreground ,base00))))
(message-header-cc ((t (:foreground ,green :bold t))))
(message-header-to ((t (:foreground ,base1 :bold t)))))))))
(defun color-theme-solarized-dark () (defun color-theme-solarized-dark ()
(interactive) (interactive)