home

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

shortbrain-light-theme.el (12243B)


      1 ;;; shortbrain-light-theme.el --- A calm, light, almost monochrome color theme based on emacs-shortbrain-theme.
      2 
      3 ;; Copyright (C) 2020 Vincent Demeester <vincent@sbr.pm>
      4 
      5 ;; Author: Vincent Demeester <vincent@sbr.pm>
      6 ;; Keywords: themes
      7 ;; URL: https://github.com/vdemeester/emacs-config
      8 ;; Version: 2020.03
      9 ;; Package-Requires: ((emacs "24.1"))
     10 
     11 ;; This program is free software; you can redistribute it and/or modify
     12 ;; it under the terms of the GNU General Public License as published by
     13 ;; the Free Software Foundation, either version 3 of the License, or
     14 ;; (at your option) any later version.
     15 
     16 ;; This program is distributed in the hope that it will be useful,
     17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
     18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     19 ;; GNU General Public License for more details.
     20 
     21 ;; You should have received a copy of the GNU General Public License
     22 ;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
     23 
     24 ;;; Commentary:
     25 
     26 ;; To use the shortbrain-light theme, add the following to your Emacs
     27 ;; configuration file:
     28 ;;
     29 ;;   (load-theme 'shortbrain-light)
     30 ;;
     31 ;; Requirements: Emacs 24.
     32 
     33 ;;; Code:
     34 
     35 
     36 (deftheme shortbrain-light "A calm, light, almost monochrome color theme")
     37 
     38 
     39 (defconst shortbrain-light-theme-colors
     40   '(;; Basics
     41     (white . "#ffffff")
     42 
     43     ;; Greys
     44     (default-grey . "#0f1619")
     45     (grey . "#0f1619")
     46     (grey-50 . "#fdfdfe")
     47     (grey-100 . "#f5f8fa")
     48     (grey-200 . "#d8dcde")
     49     (grey-300 . "#bcc0c2")
     50     (grey-400 . "#9fa3a6")
     51     (grey-500 . "#9fa3a6")
     52     (grey-600 . "#656b6e")
     53     (grey-700 . "#494f52")
     54     (grey-720 . "#474d50")
     55     (grey-800 . "#2c3236")
     56     (grey-820 . "#1e2428")
     57     (grey-850 . "#1d2226")
     58     (grey-900 . "#0f1619")
     59 
     60     ;; Primaries
     61     (default-primary . "#0be5e5")
     62     (primary . "#0be5e5")
     63     (primary-50 . "#f3fefe")
     64     (primary-100 . "#d4fafa")
     65     (primary-200 . "#91f3f3")
     66     (primary-300 . "#4eecec")
     67     (primary-400 . "#0be5e5")
     68     (primary-500 . "#09cccc")
     69     (primary-600 . "#07b3b3")
     70     (primary-700 . "#059999")
     71     (primary-800 . "#028080")
     72     (primary-900 . "#006666")
     73 
     74     ;; Greens
     75     (default-green . "#0be541")
     76     (green . "#0be441")
     77     (green-50 . "#e7feec")
     78     (green-100 . "#b6fcc7")
     79     (green-200 . "#85f9a2")
     80     (green-300 . "#3cf66b")
     81     (green-400 . "#0be441")
     82     (green-500 . "#0adb3f")
     83     (green-600 . "#09c338")
     84     (green-700 . "#08aa31")
     85     (green-800 . "#07922a")
     86     (green-900 . "#067a23")
     87 
     88     ;; Reds
     89     (default-red. "#f24965")
     90     (red . "#f24965")
     91     (danger . "#f24965")
     92     (red-50 . "#fff0f2")
     93     (red-100 . "#ffd9df")
     94     (red-200 . "#fba9b6")
     95     (red-300 . "#f6798e")
     96     (red-400 . "#f24965")
     97     (red-500 . "#d6455d")
     98     (red-600 . "#ba4054")
     99     (red-700 . "#9e3c4c")
    100     (red-800 . "#823743")
    101     (red-900 . "#66333b")
    102 
    103     ;; Purples
    104     (purple . "#b965e8")))
    105 
    106 
    107 (defun shortbrain-light-theme-color (name)
    108   "Return the shortbrain-light theme color with the given NAME."
    109   (cdr (assoc name shortbrain-light-theme-colors)))
    110 
    111 
    112 (let ((class                    '((class color) (min-colors 256)))
    113       (default-fg               (shortbrain-light-theme-color 'grey-900))
    114       (default-bg               (shortbrain-light-theme-color 'grey-50))
    115       (inactive-bg               (shortbrain-light-theme-color 'grey-200))
    116       (minor-fg                 (shortbrain-light-theme-color 'grey-200))
    117       (minor-bg                 (shortbrain-light-theme-color 'grey-50))
    118       (inactive-fg              (shortbrain-light-theme-color 'grey-600))
    119       (border-fg                (shortbrain-light-theme-color 'grey-200))
    120       (frame-fg                 (shortbrain-light-theme-color 'grey-500))
    121       (cursor-fg                (shortbrain-light-theme-color 'grey-900))
    122       (cursor-bg                (shortbrain-light-theme-color 'grey-300))
    123 
    124       ;; Scrollbars
    125       (scrollbar-fg             (shortbrain-light-theme-color 'grey-600))
    126       (scrollbar-bg             (shortbrain-light-theme-color 'grey-100))
    127 
    128       ;; Highlighting
    129       (highlight-fg             (shortbrain-light-theme-color 'white))
    130       (highlight-bg             (shortbrain-light-theme-color 'red))
    131 
    132       ;; Current line
    133       (hl-line-bg               (shortbrain-light-theme-color 'grey-100))
    134 
    135       ;; Search
    136       (search-fg                (shortbrain-light-theme-color 'white))
    137       (search-bg                (shortbrain-light-theme-color 'primary-600))
    138       (search-bg-0              (shortbrain-light-theme-color 'primary-500))
    139       (search-bg-1              (shortbrain-light-theme-color 'primary-400))
    140       (search-bg-2              (shortbrain-light-theme-color 'primary-300))
    141       (search-bg-3              (shortbrain-light-theme-color 'primary-100))
    142 
    143       ;; Selection
    144       (selection-bg             (shortbrain-light-theme-color 'grey-200))
    145 
    146       ;; Auto-completion
    147       (completion-fg            (shortbrain-light-theme-color 'grey-500))
    148       (completion-bg            (shortbrain-light-theme-color 'grey-800))
    149       (completion-match-fg      (shortbrain-light-theme-color 'red-500))
    150       (completion-mouse-fg      (shortbrain-light-theme-color 'white))
    151       (completion-selection-fg  (shortbrain-light-theme-color 'red-500))
    152       (completion-selection-bg  (shortbrain-light-theme-color 'grey-200))
    153       (completion-annotation-fg (shortbrain-light-theme-color 'red-400))
    154 
    155       ;; Warnings & errors
    156       (warning-fg               (shortbrain-light-theme-color 'white))
    157       (warning-bg               (shortbrain-light-theme-color 'red-600))
    158       (error-fg                 (shortbrain-light-theme-color 'white))
    159       (error-bg                 (shortbrain-light-theme-color 'red))
    160 
    161       ;; Org
    162       (org-color-1              (shortbrain-light-theme-color 'green-900))
    163       (org-color-2              (shortbrain-light-theme-color 'purple))
    164       (org-color-3              (shortbrain-light-theme-color 'primary-700))
    165       (org-color-4              (shortbrain-light-theme-color 'primary-500))
    166       (org-color-5              (shortbrain-light-theme-color 'primary-400))
    167       (org-meta-fg              (shortbrain-light-theme-color 'primary-900))
    168 
    169       ;; Language syntax highlighting
    170       (variable-fg              (shortbrain-light-theme-color 'black))
    171       (function-fg              (shortbrain-light-theme-color 'grey-900))
    172       (type-fg                  (shortbrain-light-theme-color 'grey-700))
    173       (constant-fg              (shortbrain-light-theme-color 'grey-600))
    174       (keyword-fg               (shortbrain-light-theme-color 'grey-500))
    175       (builtin-fg               (shortbrain-light-theme-color 'grey-400))
    176       (string-fg                (shortbrain-light-theme-color 'grey-600))
    177       (doc-fg                   (shortbrain-light-theme-color 'primary-600))
    178       (doc-bg                   (shortbrain-light-theme-color 'grey-50)))
    179   (custom-theme-set-faces
    180    'shortbrain-light
    181    ;; Regular
    182    `(cursor ((,class (:foreground ,cursor-fg :background ,cursor-bg))))
    183    `(default ((,class (:foreground ,default-fg :background ,default-bg))))
    184    `(default-italic ((,class (:italic t))))
    185 
    186    ;; Emacs UI
    187    `(fringe ((,class (:foreground ,error-fg :background ,default-bg))))
    188    `(header-line ((,class :background ,default-bg)))
    189    `(linum ((,class (:inherit shadow :background ,default-bg))))
    190    `(mode-line ((,class (:foreground ,frame-fg :background ,default-bg
    191                                      :box (:line-width -1 :color ,default-bg)))))
    192    `(mode-line-inactive ((,class (:foreground ,inactive-fg :background ,inactive-bg
    193                                               :box (:line-width -1 :color ,inactive-bg)))))
    194    `(nlinum-relative-current-face ((,class (:foreground ,frame-fg :background ,default-bg))))
    195    `(vertical-border ((,class (:foreground ,border-fg :background ,default-bg))))
    196    `(tab-bar ((,class (:background ,default-bg))))
    197    `(tab-bar-tab ((,class (:background ,default-bg :inherit shadow :weight bold))))
    198    `(tab-bar-tab-inactive ((,class (:background ,inactive-bg :inherit shadow :weight normal))))
    199 
    200    ;; Highlighting
    201    `(highlight ((,class (:foreground ,highlight-fg :background ,highlight-bg))))
    202    `(hl-line ((,class (:background ,hl-line-bg))))
    203 
    204    ;; Search
    205    `(isearch ((,class (:foreground ,search-fg :background ,search-bg :weight bold))))
    206    `(lazy-highlight ((,class (:foreground ,highlight-fg :background ,highlight-bg) :weight normal)))
    207 
    208    ;; Selection
    209    `(region ((,class (:background ,selection-bg))))
    210 
    211    ;; Erroneous whitespace
    212    `(whitespace-line ((,class (:foreground ,error-fg :background ,error-bg))))
    213    `(whitespace-space ((,class (:foreground ,builtin-fg :background ,hl-line-bg))))
    214    `(whitespace-tab ((,class (:foreground ,builtin-fg :background ,hl-line-bg))))
    215 
    216    ;; Language syntax highlighting
    217    `(font-lock-builtin-face ((,class (:foreground ,builtin-fg))))
    218    `(font-lock-comment-face ((,class (:foreground ,doc-fg :background ,doc-bg))))
    219    `(font-lock-comment-delimiter-face ((,class (:foreground ,minor-fg, :background ,minor-bg))))
    220    `(font-lock-constant-face ((,class (:foreground ,constant-fg))))
    221    `(font-lock-doc-face ((,class (:foreground ,doc-fg))))
    222    `(font-lock-function-name-face ((,class (:foreground ,function-fg))))
    223    `(font-lock-keyword-face ((,class (:foreground ,keyword-fg))))
    224    `(font-lock-negation-char-face ((,class (:foreground ,error-fg))))
    225    `(font-lock-preprocessor-face ((,class (:foreground ,builtin-fg))))
    226    `(font-lock-string-face ((,class (:foreground ,string-fg))))
    227    `(font-lock-type-face ((,class (:foreground ,type-fg))))
    228    `(font-lock-variable-name-face ((,class (:foreground ,variable-fg))))
    229    `(font-lock-warning-face ((,class (:foreground ,warning-fg :background ,warning-bg))))
    230 
    231    ;; Org
    232    `(org-level-1 ((,class (:foreground ,org-color-1 :bold t :height 1.2))))
    233    `(org-level-2 ((,class (:foreground ,org-color-2 :bold t :height 1.1))))
    234    `(org-level-3 ((,class (:foreground ,org-color-3 :bold t :height 1.0))))
    235    `(org-level-4 ((,class (:foreground ,org-color-4 :bold t :height 1.0))))
    236    `(org-level-5 ((,class (:foreground ,org-color-5 :bold t :height 1.0))))
    237    `(org-level-6 ((,class (:foreground ,org-color-5 :bold t :height 1.0))))
    238    `(org-document-title ((,class (:bold t :foreground ,org-meta-fg :height 1.4))))
    239    `(org-meta-line ((,class (:foreground ,org-meta-fg :bold t))))
    240 
    241    ;; Avy
    242    `(avy-lead-face   ((,class (:background ,search-bg-0 :foreground ,search-fg))))
    243    `(avy-lead-face-0 ((,class (:background ,search-bg-1 :foreground ,search-fg))))
    244    `(avy-lead-face-1 ((,class (:background ,search-bg-2 :foreground ,search-fg))))
    245    `(avy-lead-face-2 ((,class (:background ,search-bg-3 :foreground ,search-fg))))
    246 
    247    ;; Company (auto-completion)
    248    `(company-preview ((,class (:background ,default-bg :foreground ,completion-match-fg))))
    249    `(company-preview-common ((,class (:background ,completion-bg :foreground ,completion-fg))))
    250    `(company-preview-search ((,class (:background ,completion-bg :foreground ,completion-fg))))
    251    `(company-scrollbar-bg ((,class (:background ,scrollbar-bg))))
    252    `(company-scrollbar-fg ((,class (:background ,scrollbar-fg))))
    253    `(company-tooltip ((,class (:background ,completion-bg :foreground ,completion-fg))))
    254    `(company-tooltip-annotation ((,class (:foreground ,completion-annotation-fg))))
    255    `(company-tooltip-common ((,class (:background nil :foreground ,completion-match-fg))))
    256    `(company-tooltip-common-selection ((,class (:foreground ,completion-selection-fg
    257                                                             :background ,completion-selection-bg))))
    258    `(company-tooltip-mouse ((,class (:background ,selection-bg :foreground ,completion-mouse-fg))))
    259    `(company-tooltip-search ((,class (:foreground ,completion-match-fg))))
    260    `(company-tooltip-selection ((,class (:background ,selection-bg :foreground nil))))))
    261 
    262 
    263 ;;;###autoload
    264 (when (and (boundp 'custom-theme-load-path)
    265            load-file-name)
    266   ;; add theme folder to `custom-theme-load-path' when installing over MELPA
    267   (add-to-list 'custom-theme-load-path
    268                (file-name-as-directory (file-name-directory load-file-name))))
    269 
    270 
    271 (provide-theme 'shortbrain-light)
    272 (provide 'shortbrain-light-theme)
    273 
    274 
    275 ;;; shortbrain-light-theme.el ends here