Spacemacs自定义颜色

营养餐

我最近改用了Spacemacs,并且尝试合并自己的自定义颜色主题。通常,我会这样做。

(setq-default dotspacemacs-themes '(firebelly))  ;; additionally use with spacemacs

(use-package firebelly-theme
  :config (progn
        (let
        ;; This beautiful palette is shamelessly stolen from chris
        ;; kempson's base16: https://github.com/chriskempson/base16
        ;; I keep a local copy of the firebelly colour layout so I
        ;; can tweak it to my taste
        ((palette
          '("#ac4142" "#d28445" "#f4bf75" "#90a959"
            "#75b5aa" "#6a9fb5" "#aa759f" "#8f5536"))
         ;; Simple grayscale palette.
         (greys
          '("#222222" "#292929" "#444444" "#555555"
            "#666666" "#777777" "#888888" "#999999")))
          ;; Tiny functions to make getting from the palettes easier.
          (cl-flet
          ((color (n) (nth n palette))
           (grey (n) (nth n greys)))
        ;; Define some faces for our theme.
        (custom-theme-set-faces
         'firebelly
                 ;;;; Styling emacs.
         `(default
            ((t (:background ,(grey 0) :foreground ,(grey 7)))))
         `(cursor
           ((t (:background ,(grey 3)))))
         `(highlight
           ((t (:background ,(color 5) :foreground ,(grey 3)))))
         `(shadow
           ((t (:foreground ,(grey 6)))))
         `(isearch
           ((t (:background ,(grey 2) :foreground ,(color 6)))))
         `(query-replace
           ((t (:background ,(grey 2) :foreground ,(color 6)))))
         `(lazy-highlight
           ((t (:background ,(grey 1) :foreground ,(grey 3)))))
         `(minibuffer-prompt
           ((t (:foreground ,(color 1)))))
         `(trailing-whitespace
           ((t (:background ,(grey 1)))))
         `(nobreak-space
           ((t (:background ,(grey 1)))))
         `(escape-glyph
           ((t (:foreground ,(color 2)))))
         ;; Fringes are ugly.
         `(fringe
           ((t (:background ,(grey 0)))))
         ;; Highlight the border.
         `(vertical-border
           ((t (:foreground ,(grey 1)))))
         ;; Mode lines look the same but for the text.
         `(mode-line
           ((t (:background ,(grey 1) :foreground ,(grey 6) :box nil))))
         `(mode-line-inactive
           ((t (:background ,(grey 1) :foreground ,(grey 3) :box nil))))
         `(header-line
           ((t (:background ,(grey 1) :foreground ,(grey 3) :box nil))))
         `(mode-line-buffer-id
           ((t (:bold t))))
         `(mode-line-highlight
           ((t (:foreground ,(grey 7)))))
         ;; Regions are slightly lighter.
         `(region
           ((t (:background ,(grey 2)))))
         `(secondary-selection
           ((t (:background ,(grey 2)))))
    ;;;; Styling code.
         ;; Comments are lighter than their delimiters.
         `(font-lock-comment-face
           ((t (:foreground ,(grey 4)))))
         `(font-lock-comment-delimiter-face
           ((t (:foreground ,(grey 2)))))
         ;; Docstrings are slightly lighter.
         `(font-lock-doc-face
           ((t (:foreground ,(grey 4) :background ,(grey 0)))))
         `(font-lock-function-name-face
           ((t (:foreground ,(color 3)))))
         `(font-lock-variable-name-face
           ((t (:foreground ,(grey 2)))))
         `(font-lock-builtin-face
           ((t (:foreground ,(color 6)))))
         `(font-lock-constant-face
           ((t (:foreground ,(color 1)))))
         `(font-lock-type-face
           ((t (:foreground ,(color 4)))))
         `(font-lock-string-face
           ((t (:foreground ,(color 5) :background ,(grey 1)))))
         `(font-lock-keyword-face
           ((t (:foreground ,(color 6)))))
    ;;;; Styling extensions.
         ;; Erc faces.
         `(erc-notice-face
           ((t (:foreground ,(grey 2)))))
         `(erc-current-nick-face
           ((t (:foreground ,(color 3) :bold t))))
         `(erc-prompt-face
           ((t (:foreground ,(color 1) :background ,(grey 0)))))
         `(erc-input-face
           ((t (:foreground ,(grey 6)))))
         `(erc-my-nick-face
           ((t (:foreground ,(color 1)))))
         `(erc-error-face
           ((t (:foreground ,(color 0)))))
         `(erc-timestamp-face
           ((t (:foreground ,(color 3)))))
         ;; Rainbow delimiters are mostly in order.
         `(rainbow-delimiters-depth-1-face
           ((t (:foreground ,(color 7)))))
         `(rainbow-delimiters-depth-2-face
           ((t (:foreground ,(color 6)))))
         `(rainbow-delimiters-depth-3-face
           ((t (:foreground ,(color 5)))))
         `(rainbow-delimiters-depth-4-face
           ((t (:foreground ,(grey 3)))))
         `(rainbow-delimiters-depth-5-face
           ((t (:foreground ,(color 4)))))
         `(rainbow-delimiters-depth-6-face
           ((t (:foreground ,(color 3)))))
         `(rainbow-delimiters-depth-7-face
           ((t (:foreground ,(color 2)))))
         `(rainbow-delimiters-depth-8-face
           ((t (:foreground ,(color 1)))))
         `(rainbow-delimiters-depth-9-face
           ((t (:foreground ,(color 0)))))
         ;; shm faces
         `(shm-current-face
           ((t (:background ,(grey 1)))))
         `(shm-quarantine-face
           ((t (:foreground ,(color 0) :background ,(grey 1)))))
         ;; linum-relative faces
         `(linum-relative-current-face
           ((t (:background ,(grey 0) :foreground ,(color 1))))))))))

Spacemacs具有自定义主题和颜色的机制但这在我的自定义层中直接调用时不起作用(请参见此处此处)。

营养餐

好的,也解决了这个问题。我只是拿起了火肚的回购,将它变成了一个spacemacs层。为此,我所做的就是:

  1. 将回购作为子目录克隆到我的.spacemacs.d / layers目录中。
  2. packages.el-> firebelly-theme.el(A)建立了一个软链接
  3. dotspacemacs-configuration-layers.spacemacs.d / init.el中的(B)中的配置层列表中添加了新的firebelly层

一种)

firebelly/
├── firebelly-theme.el
├── packages.el -> firebelly-theme.el
├── readme.md
└── screenshot.png

B)

dotspacemacs-configuration-layers
   '(
     ...
     firebelly)

希望这对其他人有帮助。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章