;;; lcars-theme.el --- A color theme ;; Copyright (C) 2011 Julien Danjou ;; Authors: Julien Danjou ;; This file is NOT part of GNU Emacs. ;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . ;;; Code: (deftheme lcars "LCARS theme.") ;; We want the face to be created even if they do not exist. (put 'lcars 'theme-immediate t) ;; These colors are stolen from Tango. (setq lcars-colors '((((class color) (min-colors 65535)) (lcars-1 . "#FF9900") (lcars-2 . "#CC99CC") (lcars-3 . "#9999CC") (lcars-4 . "#CC6666") (lcars-5 . "#FFCC99") (lcars-6 . "#9999FF") (lcars-7 . "#FF9966") (lcars-8 . "#CC6699") (lcars-background . "#000000") (lcars-border . "#666666") (lcars-selected . "#FFFFFF") (lcars-red . "#FF0000") (aluminium-1 . "#eeeeec") (aluminium-2 . "#d3d7cf") (aluminium-3 . "#babdb6") (aluminium-4 . "#888a85") (aluminium-5 . "#555753") (aluminium-6 . "#2e3436") (butter-1 . "#fce94f") (butter-2 . "#edd400") (butter-3 . "#c4a000") (orange-1 . "#fcaf3e") (orange-2 . "#f57900") (orange-3 . "#ce5c00") (chocolate-1 . "#e9b96e") (chocolate-2 . "#c17d11") (chocolate-3 . "#9f5902") (chameleon-1 . "#8ae234") (chameleon-2 . "#73d216") (chameleon-3 . "#4e9a06") (sky-blue-1 . "#729fcf") (sky-blue-2 . "#3465a4") (sky-blue-3 . "#204a87") (plum-1 . "#ad7fa8") (plum-2 . "#75507b") (plum-3 . "#5c3566") (scarlet-red-1 . "#ef2929") (scarlet-red-2 . "#cc0000") (scarlet-red-3 . "#a40000") (background . "#252A2B") (black . "#0c191C") (gradient-1 . "#729fcf") ;; sky-blue-1 (gradient-2 . "#8ae234") ;; chameleon-1 (gradient-3 . "#fce94f") ;; butter-1 (gradient-4 . "#ad7fa8") ;; plum-1 (gradient-5 . "#e9b96e") ;; chocolate-1 (gradient-6 . "#fcaf3e") ;; orange-1 (gradient-7 . "#3465a4") ;; sky-blue-2 (gradient-8 . "#73d216") ;; chameleon-2 (gradient-9 . "#f57900") ;; orange-2 (gradient-10 . "#75507b") ;; plum-2 (gradient-11 . "#c17d11") ;; chocolate-2 ) (t (aluminium-1 . "color-255") (aluminium-2 . "color-253") (aluminium-3 . "color-251") (aluminium-4 . "color-245") (aluminium-5 . "color-240") (aluminium-6 . "color-235") (butter-1 . "color-221") (butter-2 . "color-220") (butter-3 . "color-178") (orange-1 . "color-214") (orange-2 . "color-208") (orange-3 . "color-130") (chocolate-1 . "color-180") (chocolate-2 . "color-172") (chocolate-3 . "color-94") (chameleon-1 . "color-82") (chameleon-2 . "color-76") (chameleon-3 . "color-34") (sky-blue-1 . "color-117") (sky-blue-2 . "color-63") (sky-blue-3 . "color-24") (plum-1 . "color-176") (plum-2 . "color-96") (plum-3 . "color-54") (scarlet-red-1 . "color-196") (scarlet-red-2 . "color-160") (scarlet-red-3 . "color-124") (background . "color-234") (black . "color-16") (gradient-1 . "color-117") ;; sky-blue-1 (gradient-2 . "color-82") ;; chameleon-1 (gradient-3 . "color-221") ;; butter-1 (gradient-4 . "color-176") ;; plum-1 (gradient-5 . "color-180") ;; chocolate-1 (gradient-6 . "color-214") ;; orange-1 (gradient-7 . "color-63") ;; sky-blue-2 (gradient-8 . "color-76") ;; chameleon-2 (gradient-9 . "color-208") ;; orange-2 (gradient-10 . "color-96") ;; plum-2 (gradient-11 . "color-172") ;; chocolate-2 ))) ; "The color values for each color name for a given ; condition. The format is: ((condition) (key . value) (key ; . value) ...)") (defun lcars-get-colors (name) (cdr (assoc name (car lcars-colors)))) (setq ansi-term-color-vector `[unspecified ,(lcars-get-colors 'black) ,(lcars-get-colors 'scarlet-red-1) ,(lcars-get-colors 'chameleon-1) ,(lcars-get-colors 'butter-1) ,(lcars-get-colors 'sky-blue-1) ,(lcars-get-colors 'plum-1) "cyan3" ,(lcars-get-colors 'aluminium-1)]) (defun lcars-simple-face-to-multiple (face) (let ((spec (car face)) (lst (cadr face))) (list spec (mapcar '(lambda (entry) (let ((color-condition (car entry))) (list color-condition (lcars-color-list-expand (cdr entry) lst)))) lcars-colors)))) (defun lcars-color-list-expand (color-alist lst) (let ((result '())) (while (car lst) (let ((key (car lst)) (val (cadr lst))) (if (memq key '(:foreground :background :color)) (setq val (or (cdr (assq val color-alist)) val))) (if (listp val) (setq val (lcars-color-list-expand entry val))) (setq result (append result `(,key ,val)))) (setq lst (cddr lst))) result)) (defun lcars-theme-set-faces (theme &rest args) (apply 'custom-theme-set-faces (append (list theme) (mapcar 'lcars-simple-face-to-multiple args)))) (lcars-theme-set-faces 'lcars '(default (:background lcars-background :foreground lcars-1)) '(shadow (:foreground lcars-border)) '(secondary-selection (:background lcars-red)) '(cursor (:background lcars-1)) '(hl-line (:foreground lcars-selected)) '(highlight (:foreground lcars-selected)) '(fringe (:background lcars-background)) '(mode-line (:foreground lcars-1 :background lcars-background :box (:line-width 1 :color lcars-border))) '(mode-line-inactive (:foreground lcars-1 :background lcars-background :box nil)) '(mode-line-buffer-id (:bold t :foreground lcars-2)) '(header-line (:foreground lcars-1 :background lcars-background :box (:line-width 1 :color lcars-border))) '(region (:background lcars-border)) '(link (:foreground lcars-2)) '(link-visited (:inherit 'link :foreground lcars-4)) '(match (:bold t :foreground lcars-selected)) '(tooltip (:inherit 'variable-pitch :foreground aluminium-1 :background black)) '(bold (:bold t)) '(italic (:italic t)) '(font-lock-builtin-face (:foreground lcars-6)) '(font-lock-keyword-face (:inherit 'font-lock-builtin-face :bold t)) '(font-lock-comment-face (:inherit 'shadow :italic t)) '(font-lock-comment-delimiter-face (:inherit 'font-lock-comment-face)) '(font-lock-constant-face (:foreground lcars-4)) '(font-lock-type-face (:inherit 'font-lock-constant-face :bold t)) '(font-lock-doc-face (:inherit 'shadow)) '(font-lock-string-face (:foreground lcars-3)) '(font-lock-variable-name-face (:foreground lcars-8)) '(font-lock-warning-face (:bold t :foreground lcars-red)) '(font-lock-function-name-face (:foreground lcars-2 :bold t)) '(comint-highlight-prompt ()) '(isearch (:background orange-3 :foreground background)) '(isearch-fail (:background scarlet-red-2)) '(lazy-highlight (:background chocolate-1 :foreground background)) '(show-paren-match-face (:background chameleon-3)) '(show-paren-mismatch-face (:background plum-3)) '(minibuffer-prompt (:foreground sky-blue-1 :bold t)) ;; '(widget-mouse-face ((t (:bold t :foreground aluminium-1 :background scarlet-red-2)))) ;; '(widget-field ((t (:foreground orange-1 :background "gray30")))) ;; '(widget-single-line-field ((t (:foreground orange-1 :background "gray30")))) '(custom-group-tag (:bold t :foreground orange-2 :height 1.3)) '(custom-variable-tag (:bold t :foreground butter-2 :height 1.1)) '(custom-face-tag (:bold t :foreground butter-2 :height 1.1)) '(custom-state (:foreground sky-blue-1)) ;; '(custom-button ((t :background "gray50" :foreground black ;; :box (:line-width 1 :style released-button)))) ;; '(custom-variable-button ((t (:inherit 'custom-button)))) ;; '(custom-button-mouse ((t (:inherit 'custom-button :background "gray60")))) ;; '(custom-button-unraised ((t (:background "gray50" :foreground "black")))) ;; '(custom-button-mouse-unraised ((t (:inherit 'custom-button-unraised :background "gray60")))) ;; '(custom-button-pressed ((t (:inherit 'custom-button :box (:style pressed-button))))) ;; '(custom-button-mouse-pressed-unraised ((t (:inherit 'custom-button-unraised :background "gray60")))) '(custom-documentation (:inherit 'font-lock-comment-face)) '(gnus-cite-1 (:foreground gradient-1)) '(gnus-cite-2 (:foreground gradient-2)) '(gnus-cite-3 (:foreground gradient-3)) '(gnus-cite-4 (:foreground gradient-4)) '(gnus-cite-5 (:foreground gradient-5)) '(gnus-cite-6 (:foreground gradient-6)) '(gnus-cite-7 (:foreground gradient-7)) '(gnus-cite-8 (:foreground gradient-8)) '(gnus-cite-9 (:foreground gradient-9)) '(gnus-cite-10 (:foreground gradient-10)) '(gnus-cite-11 (:foreground gradient-11)) '(gnus-header-name (:bold t :foreground sky-blue-1)) '(gnus-header-from (:bold t)) '(gnus-header-to (:bold t :foreground aluminium-2)) '(gnus-header-subject ()) '(gnus-header-content (:italic t :foreground aluminium-2)) '(gnus-header-newsgroups (:inherit 'gnus-header-to)) '(gnus-signature (:italic t :foreground aluminium-3)) '(gnus-summary-cancelled (:background black :foreground butter-1)) '(gnus-summary-normal-ancient (:foreground chameleon-3)) '(gnus-summary-normal-read (:foreground chameleon-1)) '(gnus-summary-normal-ticked (:foreground scarlet-red-1)) '(gnus-summary-normal-unread (:foreground aluminium-1)) '(gnus-summary-high-ancient (:inherit 'gnus-summary-normal-ancient)) '(gnus-summary-high-read (:inherit 'gnus-summary-normal-read)) '(gnus-summary-high-ticked (:inherit 'gnus-summary-normal-ticked)) '(gnus-summary-high-unread (:inherit 'gnus-summary-normal-unread)) '(gnus-summary-low-ancient (:inherit 'gnus-summary-normal-ancient :italic t)) '(gnus-summary-low-read (:inherit 'gnus-summary-normal-read :italic t)) '(gnus-summary-low-ticked (:inherit 'gnus-summary-normal-ticked :italic t)) '(gnus-summary-low-unread (:inherit 'gnus-summary-normal-unread :italic t)) '(gnus-summary-selected (:background sky-blue-3 :foreground aluminium-1)) '(gnus-button (:bold t :foreground aluminium-2)) '(spam (:background black :foreground orange-2)) '(message-header-newsgroups (:inherit gnus-header-newsgroups)) '(message-header-name (:inherit 'gnus-header-name)) '(message-header-to (:inherit gnus-header-to)) '(message-header-other (:inherit gnus-header-content)) '(message-header-subject (:inherit 'gnus-header-subject)) '(message-header-cc (:foreground aluminium-2)) '(message-header-xheader (:foreground aluminium-4)) '(message-separator (:foreground sky-blue-3)) '(message-mml (:foreground chameleon-1)) ;; org-mode '(org-level-1 (:bold t :foreground lcars-1 :height 1.3)) '(org-level-2 (:bold t :foreground lcars-2 :height 1.2)) '(org-level-3 (:bold t :foreground lcars-3 :height 1.1)) '(org-level-4 (:bold t :foreground lcars-4)) '(org-level-5 (:bold t :foreground lcars-5)) '(org-level-6 (:bold t :foreground lcars-6)) '(org-level-7 (:bold t :foreground lcars-7)) '(org-level-8 (:bold t :foreground lcars-8)) '(org-mode-line-clock ()) '(org-mode-line-clock-overrun (:foreground scarlet-red-1)) '(org-document-title (:bold t :foreground sky-blue-1 :height 1.4)) '(org-document-info (:foreground sky-blue-1 :italic t)) '(org-todo (:bold t :foreground scarlet-red-2)) '(org-done (:bold t :foreground chameleon-3)) '(org-hide (:foreground background)) '(org-scheduled (:foreground chameleon-2)) '(org-scheduled-previously (:foreground orange-2)) '(org-scheduled-today (:foreground chameleon-1)) '(org-date (:foreground chocolate-1)) '(org-special-keyword (:foreground scarlet-red-1 :bold t)) '(org-agenda-done ()) '(org-time-grid (:inherit 'shadow)) '(org-agenda-date (:foreground butter-1 :height 1.2)) '(org-agenda-date-today (:inherit 'org-agenda-date :foreground butter-2 :weight bold :height 1.3)) '(org-agenda-date-tc (:inherit 'org-agenda-date :foreground butter-3)) '(org-agenda-date-weekend (:inherit 'org-agenda-date :foreground scarlet-red-1 :weight bold)) '(org-habit-clear-future-face (:background sky-blue-3)) '(org-habit-clear-face (:background sky-blue-2)) '(org-habit-ready-future-face (:background chameleon-3)) '(org-habit-ready-face (:background chameleon-2 :foreground black)) '(org-habit-alert-ready-future-face (:background orange-3)) '(org-habit-overdue-face (:background scarlet-red-3)) '(org-habit-overdue-future-face (:background scarlet-red-3)) ;; egocentric-mode '(egocentric-face (:foreground scarlet-red-1 :weight bold)) ;; erc '(erc-direct-msg-face (:inherit 'egocentric-face)) '(erc-header-line (:inherit 'header-line)) '(erc-input-face (:inherit 'shadow)) '(erc-my-nick-face (:inherit 'egocentric-face)) '(erc-notice-face (:foreground sky-blue-1)) '(erc-prompt-face (:background black :foreground aluminium-1 :weight bold)) '(erc-timestamp-face (:foreground aluminium-2 :weight bold)) '(erc-pal-face (:foreground chameleon-1 :weight bold)) '(erc-keyword-face (:foreground orange-1)) '(erc-fool-face (:inherit 'shadow)) '(erc-current-nick-face (:inherit 'egocentric-face)) '(which-func (:foreground sky-blue-1)) '(dired-directory (:foreground sky-blue-1)) '(dired-symlink (:bold t :foreground "cyan")) '(dired-marked (:bold t :foreground butter-1)) '(mm-uu-extract (:background aluminium-6)) ;; diff-mode '(diff-added (:foreground chameleon-2)) '(diff-changed (:foreground orange-1)) '(diff-removed (:foreground scarlet-red-1)) '(diff-hunk-header (:bold t)) '(diff-function (:foreground orange-1)) '(diff-header (:background aluminium-6)) '(diff-file-header (:foreground aluminium-1)) ;; magit '(magit-diff-add (:inherit diff-added)) '(magit-diff-del (:inherit diff-removed)) '(magit-diff-none (:inherit diff-context)) '(magit-diff-hunk-header (:inherit (magit-header diff-hunk-header))) '(magit-diff-file-header (:inherit (magit-header diff-file-header))) '(magit-log-sha1 (:foreground scarlet-red-1)) '(magit-log-graph (:foreground aluminium-2)) '(magit-item-highlight (:background aluminium-6)) '(magit-item-mark (:foreground orange-1)) '(magit-log-tag-label (:background chameleon-3 :box t :foreground aluminium-6)) '(magit-log-head-label-bisect-good (:background chameleon-2 :box t)) '(magit-log-head-label-bisect-bad (:background scarlet-red-3 :box t)) '(magit-log-head-label-remote (:foreground aluminium-6 :background butter-2 :box (:color butter-3))) '(magit-log-head-label-tags (:inherit (magit-log-tag-label))) '(magit-log-head-label-local (:foreground aluminium-1 :background sky-blue-2 :box (:color sky-blue-3))) ;; git-commit-mode '(git-commit-summary-face (:bold t)) '(git-commit-branch-face (:foreground orange-2 :bold t)) '(git-commit-nonempty-second-line-face ((:foreground scarlet-red-2))) '(git-commit-comment-face (:inherit font-lock-comment-face)) '(git-commit-known-pseudo-header-face (:inherit gnus-header-name-face)) '(git-commit-pseudo-header-face (:inherit gnus-header-content)) ;; makefile-mode '(makefile-space (:background plum-3)) ;; rainbow-delimiters '(rainbow-delimiters-depth-1-face (:foreground lcars-8)) '(rainbow-delimiters-depth-2-face (:foreground lcars-7)) '(rainbow-delimiters-depth-3-face (:foreground lcars-6)) '(rainbow-delimiters-depth-4-face (:foreground lcars-5)) '(rainbow-delimiters-depth-5-face (:foreground lcars-4)) '(rainbow-delimiters-depth-6-face (:foreground lcars-3)) '(rainbow-delimiters-depth-7-face (:foreground lcars-2)) '(rainbow-delimiters-depth-8-face (:foreground lcars-1)) ;; rst-mode '(rst-level-1-face (:foreground gradient-1 :height 1.3)) '(rst-level-2-face (:foreground gradient-2 :height 1.2)) '(rst-level-3-face (:foreground gradient-3 :height 1.1)) '(rst-level-4-face (:foreground gradient-4)) '(rst-level-5-face (:foreground gradient-5)) '(rst-level-6-face (:foreground gradient-6))) (provide-theme 'lcars) ;; Local Variables: ;; no-byte-compile: t ;; End: ;;; lcars-theme.el ends here