mirror of
https://github.com/altercation/solarized
synced 2024-11-21 19:23:02 +00:00
First pass at Emacs support. Still missing a lot of faces, and supports light/dark but none of the terminal modes or anything.
This commit is contained in:
parent
9f1ba40686
commit
d254a5b9f3
1 changed files with 101 additions and 0 deletions
101
emacs-color-theme-solarized/color-theme-solarized.el
Normal file
101
emacs-color-theme-solarized/color-theme-solarized.el
Normal file
|
@ -0,0 +1,101 @@
|
|||
(eval-when-compile
|
||||
(require 'color-theme))
|
||||
|
||||
;; `((normal (:foreground ,base0 :background ,base03))
|
||||
;; (comment (:foreground ,base01 :italic t))
|
||||
;; ((constant string character number boolean float) (:foreground ,cyan))
|
||||
;; ((identifier function directory) (:foreground ,blue))
|
||||
;; ((statement conditional repeat label operator keyword exception)
|
||||
;; (:foreground ,green))
|
||||
;; ((pre-proc include define macro pre-condit) (:foreground orange))
|
||||
;; ((type storage-class structure typedef (:foreground yellow)))
|
||||
;; ((special special-char tag delimiter special-comment debug)
|
||||
;; (:foreground ,red))
|
||||
;; (underlined (:foreground ,violet))
|
||||
;; (error (:foreground ,red :bold t))
|
||||
;; (todo (:foreground ,magenta :bold t))
|
||||
;; (special-key (:foreground ,base02))
|
||||
;; (non-text (:foreground ,base02 :bold t))
|
||||
;; ())
|
||||
|
||||
(defun color-theme-solarized (mode)
|
||||
"Color theme by Ethan Schoonover, created 2011-03-24.
|
||||
Ported to Emacs by Greg Pfeil, http://ethanschoonover.com/solarized."
|
||||
(interactive "Slight or dark? ")
|
||||
(let ((base03 "#002b36")
|
||||
(base02 "#073642")
|
||||
(base01 "#586e75")
|
||||
(base00 "#657b83")
|
||||
(base0 "#839496")
|
||||
(base1 "#93a1a1")
|
||||
(base2 "#eee8d5")
|
||||
(base3 "#fdf6e3")
|
||||
(yellow "#b58900")
|
||||
(orange "#cb4b16")
|
||||
(red "#dc322f")
|
||||
(magenta "#d33682")
|
||||
(violet "#6c71c4")
|
||||
(blue "#268bd2")
|
||||
(cyan "#2aa198")
|
||||
(green "#859900"))
|
||||
(when (eq 'light mode)
|
||||
(rotatef base03 base3)
|
||||
(rotatef base02 base2)
|
||||
(rotatef base01 base1)
|
||||
(rotatef base00 base0))
|
||||
(color-theme-install
|
||||
`(color-theme-solarized
|
||||
((foreground-color . ,base0)
|
||||
(background-color . ,base03)
|
||||
(background-mode . ,mode))
|
||||
;; basic faces
|
||||
(default ((t (:foreground ,base0))))
|
||||
(cursor ((t (:foreground ,base0 :background ,base03 :inverse-video t))))
|
||||
(escape-glyph-face ((t (:foreground ,red))))
|
||||
(fringe ((t (:foreground ,base01 :background ,base02))))
|
||||
(header-line ((t (:foreground ,base0 :background ,base2))))
|
||||
(highlight ((t (:background ,base02))))
|
||||
(isearch ((t (:foreground ,yellow :inverse-video t))))
|
||||
(menu ((t (:foreground ,base0 :background ,base02))))
|
||||
(minibuffer-prompt ((t (:foreground ,blue))))
|
||||
(mode-line
|
||||
((t (:foreground ,base1 :background ,base02
|
||||
:box (:line-width 1 :color ,base1)))))
|
||||
(mode-line-buffer-id ((t (:foreground ,base1))))
|
||||
(mode-line-inactive
|
||||
((t (:foreground ,base0 :background ,base02
|
||||
:box (:line-width 1 :color ,base02)))))
|
||||
(region ((t (:background ,base01))))
|
||||
(secondary-selection ((t (:background ,base02))))
|
||||
(trailing-whitespace ((t (:foreground ,red :inverse-video t))))
|
||||
(vertical-border ((t (:foreground ,base0))))
|
||||
;; customize faces
|
||||
(custom-button
|
||||
((t (:background ,base02 :box (:line-width 2 :style released-button)))))
|
||||
(custom-button-mouse ((t (:inherit custom-button :foreground ,base1))))
|
||||
(custom-button-pressed
|
||||
((t (:inherit custom-button-mouse
|
||||
:box (:line-width 2 :style pressed-button)))))
|
||||
(custom-comment-tag ((t (:background ,base02))))
|
||||
(custom-comment-tag ((t (:background ,base02))))
|
||||
(custom-documentation ((t (:inherit default))))
|
||||
(custom-group-tag ((t (:foreground ,orange :bold t))))
|
||||
(custom-link ((t (:foreground ,violet))))
|
||||
(custom-variable-tag ((t (:foreground ,orange :bold t))))
|
||||
;; diff faces
|
||||
(diff-added ((t (:foreground ,green :inverse-video t))))
|
||||
(diff-changed ((t (:foreground ,yellow :inverse-video t))))
|
||||
(diff-removed ((t (:foreground ,red :inverse-video t))))
|
||||
;; font-lock faces
|
||||
(font-lock-builtin-face ((t (:foreground ,green))))
|
||||
(font-lock-comment-face ((t (:foreground ,base01 :italic t))))
|
||||
(font-lock-constant-face ((t (:foreground ,cyan))))
|
||||
(font-lock-function-name-face ((t (:foreground ,blue))))
|
||||
(font-lock-keyword-face ((t (:foreground ,green))))
|
||||
(font-lock-string-face ((t (:foreground ,cyan))))
|
||||
(font-lock-type-face ((t (:foregound ,yellow))))
|
||||
(font-lock-variable-name-face ((t (:foregound ,blue))))
|
||||
(font-lock-warning-face ((t (:foreground ,red :bold t))))))))
|
||||
|
||||
(defun color-theme-solarized-dark () (color-theme-solarized 'dark))
|
||||
(defun color-theme-solarized-light () (color-theme-solarized 'light))
|
Loading…
Reference in a new issue