为了看长文档改了个护眼主题

用到了writeroom/org-margin/valign,正文字体是noto自带的宋体+Bookerly(或者字号加大一点的Symbola),等宽字体是IBM Plex。

(要注意的是,如果你的眼睛有点散光,请加宽我的八个灰阶颜色的色号到你觉得合适)

;;; notink-theme.el --- A custom theme inspired by e-ink displays -*- lexical-binding: t -*-

;; Copyright (C) 2021 MetroWind.

;; This program is free software. It comes without any warranty, to
;; the extent permitted by applicable law. You can redistribute it
;; and/or modify it under the terms of the Do What the Fuck You Want
;; to Public License, Version 2, as published by Sam Hocevar. See
;; http://www.wtfpl.net/ for more details.

;; Author: MetroWind <[email protected]>
;; URL: https://github.com/MetroWind/notink-theme
;; Keywords: faces
;; Version: 1.0
;; Package-Requires: ((emacs "26.1"))

;; 8/03/2025
;; Iris Lennon is modified from MetroWind/notink-theme and Shi Tianshu/paperlike-theme.
;; Copyright belongs to the original author.


;;; Commentary:
;;
;; Notink theme is a custom theme for Emacs. Inspired by e-ink displays,
;; it aims to be a comfortable grey-scale theme.

;;; Code:

(deftheme notink "A custom theme inspired by e-ink displays")

;; Colors
(let* (
       (color-8 "#35393b")
       (color-7 "#4c5256")
       (color-6 "#616b72")
       (color-5 "#83919a")
       (color-4 "#a9b5bd")
       (color-3 "#c4cdd3")
       (color-2 "#cccccc")
       (color-1 "#ffffff")
       )

  (custom-theme-set-faces
   'notink
   `(default ((t (:background ,color-3
                              :foreground ,color-7))))
   `(cursor ((t (:background ,color-7
                             :foreground ,color-3))))
   `(region ((t (:background ,color-7
                             :foreground ,color-3))))
   `(secondary-selection ((t (:background ,color-4
                                          :inverse-video t))))
   `(mode-line ((t (:background ,color-6
                                :foreground ,color-3
                                :box unspecified))))
   `(mode-line-buffer-id ((t (:foreground ,color-3))))
   `(mode-line-inactive ((t (:background ,color-7
                             :foreground ,color-3))))
   `(fringe ((t (:background ,color-3))))
   `(minibuffer-prompt ((t (:foreground ,color-6
                                        :inherit italic))))
   `(warning ((t (:foreground ,color-7
                              :background ,color-3
                              :weight unspecified))))

   `(vertical-border ((t ())))
   `(window-divider ((t (:foreground ,color-5))))
   `(window-divider-first-pixel ((t (:foreground ,color-5))))
   `(window-divider-last-pixel ((t (:foreground ,color-5))))
   `(line-number ((t (:foreground ,color-5))))
   `(line-number-current-line ((t (:foreground ,color-7))))
   `(parenthesis ((t (:foreground ,color-7))))
   `(completions-common-part ((t (:inverse-video unspecified
                                                 :background ,color-3))))
   `(compilation-info ((t (:inverse-video unspecified
                                          :background ,color-5))))
   `(compilation-warning ((t (:inverse-video unspecified
                                             :background ,color-7))))
   `(match ((t (:inverse-video unspecified))))
   `(help-key-binding ((t (:inverse-video unspecified
                                          :background ,color-7))))

   `(font-lock-preprocessor-face ((t (:inherit italic))))
   `(font-lock-builtin-face ((t (:foreground ,color-6))))
   `(font-lock-comment-face ((t (:foreground ,color-5
                                             :inherit italic))))
   `(font-lock-comment-delimiter-face ((t (:foreground ,color-6
                                                       :italic t))))
   `(font-lock-doc-face ((t (:inherit font-lock-comment-face
                                      :foreground ,color-5
                                      :italic t))))
   `(font-lock-constant-face ((t (:foreground ,color-6
                                              :inherit italic))))
   `(font-lock-function-name-face ((t (:foreground ,color-8
                                                   :bold t))))
   `(font-lock-keyword-face ((t (:foreground ,color-7
                                             :inherit italic))))
   `(font-lock-string-face ((t (:foreground ,color-5
                                            :background ,color-4))))
   `(font-lock-type-face ((t (:foreground ,color-6))))
   `(font-lock-variable-name-face ((t (:foreground ,color-7))))
   `(font-lock-warning-face ((t (:foreground ,color-7
                                             :background ,color-1))))

   `(isearch ((t (:background ,color-5
                  :foreground ,color-3
                  :inverse-video unspecified))))
   `(isearch-fail ((t (:inherit default
                                :inverse-video unspecified))))

   `(lazy-highlight ((t (:background ,color-1))))
   `(link ((t (:foreground ,color-6
                           :underline t))))
   `(link-visited ((t (:foreground ,color-5
                                   :underline t))))
   `(button ((t (:background ,color-1
                             :underline t
                             :foreground unspecified))))
   `(header-line ((t (:background ,color-3
                                  :foreground ,color-7))))
   `(shadow ((t (:foreground ,color-5))))
   `(show-paren-match ((t (:background ,color-6
                                       :foreground ,color-3))))
   `(show-paren-mismatch ((t (:background ,color-1
                                          :foreground ,color-7))))
   `(highlight ((t (:inverse-video unspecified
                                   :background ,color-1))))
   `(hl-line ((t (:inverse-video unspecified
                                 :background ,color-2))))
   `(widget-field ((t (:background ,color-1))))

   ;; Faces for specific prog modes
   `(sh-heredoc ((t (:foreground unspecified
                                 :inherit font-lock-string-face))))

   ;; Dired
   `(dired-directory ((t (:foreground ,color-7))))
   `(dired-symlink ((t (:foreground ,color-4))))
   `(dired-perm-write ((t (:background ,color-1))))

   ;; Diff
   `(diff-added ((t (:foreground unspecified
                                 :background ,color-1))))
   `(diff-removed ((t (:foreground ,color-3
                                   :background ,color-5))))
   `(diff-context ((t (:background ,color-7))))
   `(diff-file-header ((t (:background ,color-4
                                       :bold t ))))
   `(diff-header ((t (:foreground ,color-8
                                  :background ,color-4))))

   ;; Whitespace
   `(whitespace-trailing ((t (:background ,color-4))))
   `(whitespace-line ((t (:foreground ,color-4
                                      :background ,color-8))))

   ;; Rainbow delimiters
   `(rainbow-delimiters-depth-1-face ((t (:foreground ,color-7))))
   `(rainbow-delimiters-depth-2-face ((t (:foreground ,color-5))))
   `(rainbow-delimiters-depth-3-face ((t (:foreground ,color-7))))
   `(rainbow-delimiters-depth-4-face ((t (:foreground ,color-5))))
   `(rainbow-delimiters-depth-5-face ((t (:foreground ,color-7))))
   `(rainbow-delimiters-depth-6-face ((t (:foreground ,color-5))))
   `(rainbow-delimiters-depth-7-face ((t (:foreground ,color-7))))
   `(rainbow-delimiters-unmatched-face ((t (:background ,color-1))))

   ;; Magit
   `(magit-header-line                 ((t (:bold t))))
   `(magit-head                        ((t (:background ,color-3))))

   `(magit-branch-local ((t (:foreground ,color-6
                                         :background unspecified))))
   `(magit-branch-remote ((t (:foreground ,color-6
                                          :background unspecified))))
   `(magit-tag ((t (:foreground ,color-6
                                :background unspecified
                                :inherit italic))))
   `(magit-hash ((t (:foreground ,color-5))))
   `(magit-section-title ((t (:foreground ,color-7
                                          :background unspecified))))
   `(magit-section-heading ((t (:foreground ,color-7
                                            :background unspecified
                                            :bold t))))
   `(magit-section-highlight ((t (:background ,color-2))))
   `(magit-section-selection ((t (:foreground ,color-7
                                              :bold t))))
   `(magit-item-highlight ((t (:foreground ,color-7
                                           :background ,color-1))))
   `(magit-log-author ((t (:foreground ,color-6))))

   `(magit-diff-added ((t (:inherit diff-added))))
   `(magit-diff-added-highlight ((t (:inherit magit-diff-added
                                              :background ,color-3))))
   `(magit-diff-removed ((t (:inherit diff-removed))))
   `(magit-diff-removed-highlight ((t (:inherit magit-diff-removed
                                                :background ,color-3))))
   `(magit-diff-context ((t (:inherit diff-context))))
   `(magit-diff-context-highlight ((t (:inherit magit-diff-context
                                                :background ,color-3))))
   `(magit-diff-highlight ((t (:background ,color-3))))
   `(magit-diff-file-heading-highlight ((t (:background ,color-3))))

   `(magit-popup-argument ((t (:inherit font-lock-function-name-face))))
   `(magit-popup-disabled-argument ((t (:inherit font-lock-comment-face))))
   `(magit-diff-hunk-heading ((t (:foreground unspecified
                                              :background unspecified
                                              :inherit header-line))))
   `(magit-diff-hunk-heading-highlight ((t (:foreground unspecified
                                                        :background unspecified
                                                        :inherit magit-diff-hunk-heading))))

   ;; Git-gutter-fringe
   `(git-gutter-fr:modified ((t (:foreground ,color-6))))
   `(git-gutter-fr:added ((t (:foreground ,color-6))))
   `(git-gutter-fr:deleted ((t (:foreground ,color-6))))

   ;; TeX
   `(font-latex-sedate-face ((t (:foreground ,color-6))))
   `(font-latex-math-face ((t (:inherit default))))
   `(font-latex-script-char-face ((t (:inherit font-latex-math-face))))

   ;; adoc-mode
   `(markup-meta-hide-face ((t (:height 1.0
                                        :foreground ,color-5))))
   `(markup-meta-face ((t (:height 1.0
                                   :foreground ,color-6))))
   `(markup-reference-face ((t (:underline unspecified
                                           :foreground ,color-6))))
   `(markup-gen-face ((t (:inherit default
                                   :foreground unspecified))))
   `(markup-passthrough-face ((t (:inherit markup-dark))))
   `(markup-replacement-face ((t (:foreground ,color-6))))
   `(markup-list-face ((t (:bold t))))
   `(markup-secondary-text-face ((t (:height 1.0
                                             :foreground ,color-6))))
   `(markup-verbatim-face ((t (:foreground ,color-6))))
   `(markup-code-face ((t (:inherit markup-verbatim-face))))
   `(markup-typewriter-face ((t (:inherit unspecified))))
   `(markup-complex-replacement-face ((t (:background ,color-4
                                                      :foreground ,color-7))))
   `(markup-title-0-face ((t (:height 1.6
                                      :inherit markup-gen-face))))
   `(markup-title-1-face ((t (:height 1.4
                                      :inherit markup-gen-face))))
   `(markup-title-2-face ((t (:height 1.2
                                      :inherit markup-gen-face))))
   `(markup-title-3-face ((t (:height 1.0
                                      :inherit markup-gen-face))))
   `(markup-title-4-face ((t (:height 1.0
                                      :inherit markup-gen-face))))
   `(markup-title-5-face ((t (:height 1.0
                                      :inherit markup-gen-face))))

   ;; Outline
   `(outline-1 ((t (:height 1.4
                            :foreground unspecified))))
   `(outline-2 ((t (:height 1.2
                            :foreground unspecified))))
   `(outline-3 ((t (:foreground unspecified))))
   `(outline-4 ((t (:foreground unspecified))))
   `(outline-5 ((t (:foreground unspecified))))
   `(outline-6 ((t (:foreground unspecified))))
   `(outline-7 ((t (:foreground unspecified))))
   `(outline-8 ((t (:foreground unspecified))))

   ;; Org-mode
   `(org-link ((t (:underline t
                              :foreground ,color-5
                              :inherit italic))))
   `(org-hide ((t (:foreground ,color-3))))
   `(org-table ((t (:foreground ,color-7))))
   `(org-code ((t (:foreground ,color-6
                               :inherit font-lock-constant-face))))
   `(org-date ((t (:foreground ,color-5))))
   `(org-done ((t (:weight normal
                           :foreground ,color-5))))
   `(org-todo ((t (:weight normal
                           :foreground unspecified
                           :background ,color-1))))
   `(org-latex-and-related ((t (:foreground ,color-6
                                            :inherit italic))))
   `(org-checkbox ((t (:weight normal
                               :foreground ,color-5))))
   `(org-verbatim ((t (:foreground ,color-6))))
   `(org-mode-line-clock ((t (:background unspecified))))
   `(org-document-title ((t (:weight normal
                                     :foreground unspecified))))
   `(org-drawer ((t (:foreground ,color-5))))
   `(org-block ((t (:foreground ,color-6))))
   `(org-block-begin-line ((t (:inherit font-lock-comment-face))))
   `(org-block-end-line ((t (:inherit font-lock-comment-face))))
   `(org-archived ((t (:foreground ,color-5))))
   `(org-warning ((t (:background ,color-1))))

   `(org-agenda-structure ((t (:foreground ,color-6))))
   `(org-agenda-done ((t (:foreground ,color-5))))
   `(org-scheduled-today ((t (:foreground unspecified
                                          :inherit default))))
   `(org-scheduled-previously ((t (:foreground unspecified
                                               :inherit italic))))
   `(org-upcoming-deadline ((t (:foreground ,color-6
                                            :inherit italic))))
   `(org-scheduled ((t (:foreground unspecified
                                    :inherit org-scheduled-today))))
   `(org-time-grid ((t (:foreground ,color-5))))

   ;; org-tree-slide
   `(org-tree-slide-header-overlay-face ((t (:inherit font-lock-comment-face
                                                      :foreground unspecified
                                                      :background unspecified))))

   ;; Markdown
   `(markdown-header-face-1 ((t (:height 1.4
                                         :bold t))))
   `(markdown-header-face-2 ((t (:height 1.35
                                         :bold t))))
   `(markdown-header-face-3 ((t (:height 1.25
                                         :bold t))))
   `(markdown-header-face-4 ((t (:height 1.2
                                         :bold t))))
   `(markdown-header-face-5 ((t (:height 1.15
                                         :bold t))))
   `(markdown-header-face-6 ((t (:height 1.10
                                         :bold t))))
   `(markdown-header-face-7 ((t (:height 1
                                         :bold t))))

   ;; Message
   `(message-header-name ((t (:foreground ,color-6))))
   `(message-header-other ((t (:foreground ,color-5))))
   `(message-header-cc ((t (:inherit message-header-other))))
   `(message-header-newsgroups ((t (:inherit message-header-other))))
   `(message-header-xheader ((t (:inherit message-header-other))))
   `(message-header-subject ((t (:inherit default))))
   `(message-header-to ((t (:foreground ,color-6))))
   `(message-cited-text ((t (:foreground ,color-5
                                         :inherit italic))))
   `(message-mml ((t (:foreground ,color-5))))
   `(message-separator ((t (:foreground ,color-5))))

   ;; Compilation
   `(compilation-error ((t (:foreground ,color-7
                                        :background ,color-1))))
   `(compilation-info ((t (:foreground ,color-5))))
   `(compilation-warning ((t (:foreground ,color-6))))

      ;; shell
   `(sh-quoted-exec                 ((t (:inverse-video unspecified
                                                        :background ,color-7))))

   ;; IMenu
   `(imenu-list-entry-face-0          ((t (:inverse-video unspecified
                                                          :background ,color-3))))
   `(imenu-list-entry-subalist-face-0 ((t (:bold t))))

   ;; Yasnippet
   `(yas-field-highlight-face       ((t (:background ,color-2))))

   ;; SMerge
   `(smerge-refined-added           ((t (:background ,color-6))))
   `(smerge-lower                   ((t (:background ,color-5))))

   ;; Diff-hl
   `(diff-hl-insert                 ((t (:foreground ,color-5
                                                     :background ,color-1))))
   `(diff-hl-change                 ((t (:foreground ,color-3
                                                     :background ,color-7)))
   `(diff-hl-delete                 ((t (:foreground ,color-7
                                                     :background ,color-3))))

   `(eshell-prompt                  ((t (:bold t))))

   ;; Term
   `(term-color-blue                ((t (:foreground ,color-6
                                                     :background ,color-7))))
   `(term-color-green               ((t (:foreground ,color-4
                                                     :background ,color-5))))
   `(term-color-red                 ((t (:foreground ,color-2
                                                     :background ,color-3))))

   ;; Popup
   `(popup-tip-face                 ((t (:foreground ,color-7
                                                     :background ,color-3))))
   `(popup-isearch-match            ((t (:foreground ,color-8
                                                     :background ,color-4))))

   `(tooltip                        ((t ())))
   `(dired-directory                ((t (:foreground ,color-1))))

   `(fill-column-indicator          ((t (:foreground ,color-5))))
   `(scroll-bar                     ((t (:foreground ,color-7))))
   `(sp-pair-overlay-face           ((t (:background ,color-2))))
   `(sp-wrap-overlay-face           ((t (:background ,color-2))))

   `(tab-bar                        ((t ())))
   `(tab-bar-tab-group-current      ((t ())))
   `(tab-bar-tab                    ((t (:inverse-video t))))
   `(tab-bar-tab-group-inactive     ((t ())))
   `(tab-bar-tab-inactive           ((t (:bold t))))

   ;; Emacs Rime
   `(rime-preedit-face              ((t (:underline t))))
   `(rime-cursor-face               ((t (:inherit font-lock-constant-face))))
   `(rime-indicator-face            ((t ())))
   `(rime-indicator-dim-face        ((t ())))
   `(rime-candidate-num-face        ((t ())))
   `(rime-comment-face              ((t (:inherit font-lock-comment))))
   `(rime-code-face                 ((t (:bold t))))
   `(rime-default-face              ((t ())))
   `(rime-highlight-candidate-face  ((t ())))

   ;; Web Mode
   `(web-mode-function-call-face    ((t (:inherit italic))))
   `(web-mode-function-name-face    ((t (:inherit italic
                                                  :bold t))))
   `(web-mode-html-tag-bracket-face ((t (:inherit parenthesis))))
   `(web-mode-symbol-face           ((t (:inherit font-lock-constant-face))))
   `(web-mode-html-attr-name-face   ((t (:underline t))))
   `(web-mode-html-tag-face         ((t (:underline t
                                                    :background ,color-3))))
   `(css-selector                   ((t (:foreground ,color-7))))

   ;; Beancount
   `(beancount-date ((t (:foreground unspecified
                                     :inherit italic ))))
   `(beancount-account ((t (:inherit default))))

    ;; LSP
   `(lsp-headerline-breadcrumb-path-face ((t (:foreground ,color-7))))
   `(lsp-headerline-breadcrumb-path-error-face ((t (:underline unspecified
                                                               :background ,color-5))))
   `(lsp-headerline-breadcrumb-separator-face ((t (:foreground ,color-3))))

   ;; Treemacs
   `(treemacs-root-face ((t (:inherit font-lock-function-name-face
                                      :height 1.4 :underline t))))

   ;; Flymake
   `(flymake-error ((t (:underline (:style wave :color ,color-1)))))
   `(flymake-warning ((t (:underline (:style wave :color ,color-5)))))

   ;; Flycheck
   `(flycheck-error ((t (:underline (:style wave :color ,color-1)))))
   `(flycheck-warning ((t (:underline (:style wave :color ,color-5)))))

  ;; Flyspell
   `(flyspell-duplicate ((t (:underline (:style wave :color ,color-5)))))
   `(flyspell-incorrect ((t (:underline (:style wave :color ,color-1)))))

   ;; Eglot
   `(eglot-mode-line ((t (:foreground ,color-3)))))))

;;;###autoload
(and load-file-name
     (boundp 'custom-theme-load-path)
     (add-to-list 'custom-theme-load-path
                  (file-name-as-directory
                   (file-name-directory load-file-name))))

(provide-theme 'notink)

;; Local Variables:
;; no-byte-compile: t
;; End:

;;; notink-theme.el ends here
6 个赞

不错,有电纸屏那个味了。

我在boox的电子纸显示器上用Emacs,感觉挺对眼睛挺友好的

很久之前用过Kindle和一款电纸屏的mp3,大概是屏幕太小了刷新率也太低,我没像很多人那样觉得这种灰阶显示护眼。改这套主题是因为我喜欢NordTheme的冷色调又想要低对比度和易维护的色彩方案,我觉得原来那套主题就很好,但是有些细节还是很奇怪,所以我又加了一点,最后的结果就意外地像是灰阶显示的风格了。

这一套也挺好的