zen-writer.el/themes/doom-zen-writer-dark-theme.el

199 lines
7.2 KiB
EmacsLisp

;;; doom-zen-writer-dark-theme.el --- -*- lexical-binding: t; no-byte-compile: t; -*-
;;
;; Author: Yann Esposito <https://github.com/yogsototh>
;; Created: October 24, 2021
;; Version: 1.0.0
;; Keywords: custom themes, faces
;; Homepage: https://github.com/hlissner/emacs-doom-themes
;; Package-Requires: ((emacs "25.1") (cl-lib "0.5") (doom-themes "2.2.1"))
;;
;;; Code:
(require 'doom-themes)
(require 'color)
;;
;;; Variables
(defgroup doom-zen-writer-dark-theme nil
"Options for the `doom-zen-writer-dark' theme."
:group 'doom-themes)
(defcustom doom-zen-writer-dark-padded-modeline doom-themes-padded-modeline
"If non-nil, adds a 4px padding to the mode-line.
Can be an integer to determine the exact padding."
:group 'doom-zen-writer-dark-theme
:type '(or integer boolean))
;;
;;; Theme definition
(defun hsl-to-rgb (h s l)
(color-hsl-to-rgb (/ h 360.0) (/ s 100.0) (/ l 100.0)))
(defun doom-zen-writer-dark-color (l)
(let* ((hsl (hsl-to-rgb 218 12 l))
(r (* 255 (elt hsl 0)))
(g (* 255 (elt hsl 1)))
(b (* 255 (elt hsl 2))))
(format "#%02X%02X%02X" r g b)))
(def-doom-theme doom-zen-writer-dark
"theme mostly light gray; uses HSL with fixed H and S; hsl(218,12%,*)"
;; name default/256/16
((bg `(,(doom-zen-writer-dark-color 03)))
(bg-alt `(,(doom-zen-writer-dark-color 08)))
(fg `(,(doom-zen-writer-dark-color 30)))
(fg-alt `(,(doom-zen-writer-dark-color 25)))
(accent `(,(doom-zen-writer-dark-color 40)))
(hl `(,(doom-zen-writer-dark-color 90)))
(base0 fg)
(base1 fg)
(base2 fg-alt)
(base3 fg-alt)
(base4 fg-alt)
(base5 bg-alt)
(base6 bg-alt)
(base7 bg)
(base8 bg)
(grey accent)
(red accent)
(blue accent)
(dark-blue accent)
(orange accent)
(green accent)
(teal accent)
(yellow accent)
(magenta accent)
(violet accent)
(cyan accent)
(dark-cyan accent)
;; face categories -- required for all themes
(highlight hl)
(vertical-bar accent)
(selection bg-alt)
(builtin accent)
(comments fg-alt)
(doc-comments fg)
(constants accent)
(functions accent)
(keywords accent)
(methods accent)
(operators accent)
(type accent)
(strings accent)
(variables accent)
(numbers accent)
(region accent)
(error accent)
(warning accent)
(success accent)
(vc-modified accent)
(vc-added fg-alt)
(vc-deleted accent)
;; custom categories
(-modeline-pad
(when doom-zen-writer-dark-padded-modeline
(if (integerp doom-zen-writer-dark-padded-modeline) doom-zen-writer-dark-padded-modeline 4)))
(modeline-bg bg-alt)
(modeline-bg-alt bg-alt)
(modeline-bg-inactive bg-alt)
(modeline-bg-inactive-alt bg-alt)
(modeline-fg fg)
(modeline-fg-alt fg-alt))
;;;; Base theme face overrides
((error :underline `(:style wave :color ,error))
(warning :underline `(:style wave :color ,warning))
(region :background bg-alt :foreground fg-alt) ;; selection color
(hl-sentence :foreground highlight :background bg)
((font-lock-constant-face &override) :slant 'italic)
((font-lock-comment-face &override) :slant 'italic)
((font-lock-function-name-face &override) :slant 'italic)
((font-lock-type-face &override) :slant 'italic)
(hl-line :background bg-alt)
((line-number &override) :foreground fg-alt)
((line-number-current-line &override) :foreground fg)
(mode-line
:background modeline-bg :foreground modeline-fg
:box (if -modeline-pad `(:line-width ,-modeline-pad :color ,modeline-bg)))
(mode-line-inactive
:background modeline-bg-inactive :foreground modeline-fg-alt
:box (if -modeline-pad `(:line-width ,-modeline-pad :color ,modeline-bg-inactive)))
(mode-line-emphasis :foreground highlight)
;;;; doom-modeline
(doom-modeline-bar :background modeline-bg)
(doom-modeline-bar-inactive :inherit 'doom-modeline-bar)
(doom-modeline-project-dir :foreground fg)
(doom-modeline-buffer-file :foreground fg)
(doom-modeline-buffer-modified :weight 'bold :foreground highlight)
(doom-modeline-panel :inherit 'mode-line-highlight :background fg-alt :foreground fg)
;;;; ivy
(ivy-posframe :background bg-alt)
;;;; magit
((magit-diff-added-highlight &override) :foreground fg :background (doom-blend vc-added bg 0.3))
((magit-diff-removed &override) :foreground (doom-lighten fg 0.4) :background (doom-blend vc-deleted bg 0.1))
((magit-diff-removed-highlight &override) :foreground fg :background (doom-blend vc-deleted bg 0.22))
;;;; lsp-mode
(lsp-headerline-breadcrumb-symbols-face :foreground keywords :weight 'bold)
;;;; outline <built-in>
(outline-1 :slant 'italic :foreground fg-alt)
(outline-2 :inherit 'outline-1 :foreground fg-alt)
(outline-3 :inherit 'outline-2)
(outline-4 :inherit 'outline-3)
(outline-5 :inherit 'outline-4)
(outline-6 :inherit 'outline-5)
(outline-7 :inherit 'outline-6)
(outline-8 :inherit 'outline-7)
;;;; org <built-in>
((org-block &override) :background bg-alt)
((org-block-begin-line &override) :foreground accent)
(org-agenda-done :foreground accent)
;; make unfinished cookie & todo keywords bright to grab attention
((org-todo &override) :foreground red)
;; make tags and dates to have pretty box around them
((org-tag &override) :foreground fg :background bg-alt
:box `(:line-width -1 :color ,base5 :style 'released-button))
((org-date &override) :foreground fg :background bg-alt
((org-document-info-keyword &override) :foreground fg-alt :background bg-alt)
:box `(:line-width -1 :color ,base5 :style 'released-button))
;; Make drawers and special keywords (like scheduled) to be very bleak
((org-special-keyword &override) :foreground fg-alt)
((org-drawer &override) :foreground fg-alt)
;; Make ellipsis as bleak as possible and reset underlines/boxing
(org-ellipsis :underline nil :box nil :foreground fg-alt :background bg)
;; Make blocks have a slightly different background
((org-block &override) :background bg-alt)
((org-block-begin-line &override) :foreground fg :slant 'italic)
((org-quote &override) :background bg-alt)
((org-table &override) :foreground fg)
;; org-agendamode: make "unimportant" things like distant deadlines and
;; things scheduled for today to be bleak.
(org-upcoming-deadline :foreground accent)
(org-upcoming-distant-deadline :foreground fg)
(org-scheduled :foreground fg)
(org-scheduled-today :foreground fg)
(org-scheduled-previously :foreground fg-alt)
;;;; solaire-mode
(solaire-mode-line-face
:inherit 'mode-line
:background modeline-bg-alt
:box (if -modeline-pad `(:line-width ,-modeline-pad :color ,modeline-bg-alt)))
(solaire-mode-line-inactive-face
:inherit 'mode-line-inactive
:background modeline-bg-inactive-alt
:box (if -modeline-pad `(:line-width ,-modeline-pad :color ,modeline-bg-inactive-alt)))))
;;; doom-zen-writer-dark-theme.el ends here