Skip to content

Instantly share code, notes, and snippets.

@mohkale
Created January 12, 2021 20:23
Show Gist options
  • Save mohkale/1fe76d7c467c1fbfac636613214c2566 to your computer and use it in GitHub Desktop.
Save mohkale/1fe76d7c467c1fbfac636613214c2566 to your computer and use it in GitHub Desktop.
aoh
;; an-old-hope-theme.el -- a syntax theme from a galaxy far away... -*- lexical-binding: t -*-"
;; Author: Mohsin Kaleem
;; URL: https://github.com/MoHKale/an-old-hope-theme
;; Version: 0.1.0
;; Keywords: color, theme
;; Package-Requires: ((emacs "24"))
;; This file is not part of GNU Emacs
;; This file 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, or (at your option)
;; any later version.
;; This program 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.
;; For a full copy of the GNU General Public License
;; see <http://www.gnu.org/licenses/>.
;; Commentary:
;; see https://github.com/MoHKale/an-old-hope-theme/tree/master/emacs
;; [[file:~/.config/emacs/init.org::*an old hope][an old hope:2]]
(let ((desc '"Emacs theme inspired by a galaxy far far away...
This theme is largely just a shot for shot copy of [[https://github.com/jesseleite/an-old-hope-syntax-atom][jesseleite/an-old-hope-syntax-atom]]
ported to emacs because I refuse to live with an IDE that doesn't look like it XD.
This theme isn't compatible with emacs in the terminal yet, when I find an easy way
to approximate true-color colors to non-true-color colors, then I'll add support for
it.
"))
(deftheme an-old-hope
desc)
)
;; an old hope:2 ends here
;; [[file:~/.config/emacs/init.org::*an old hope][an old hope:5]]
(let ((rainbow-delimeters-colors '("#E6B422" "#C70067" "#00A960" "#FC7482"))
(debug '"#022d3f")
(debug-256 '"#00005f")
(extra-dark-grey '"#17181b")
(extra-dark-grey-256 '"#00005f")
(line-highlight-bg '"#313339")
(line-highlight-bg-256 '"#303030")
(white '"#ffffff")
(white-256 '"#ffffff")
(black-int '"#000000")
(black-int-256 '"#000000")
(black-dim '"#2d2d38")
(black-dim-256 '"#00005f")
(black '"#212125")
(black-256 '"#262626")
(turquoise-int '"#19e5b2")
(turquoise-int-256 '"#00d7af")
(turquoise-dim '"#c1efe4")
(turquoise-dim-256 '"#afffd7")
(turquoise '"#67e4c4")
(turquoise-256 '"#5fd7d7")
(purple-int '"#c170b0")
(purple-int-256 '"#af5faf")
(purple-dim '"#ca9ac0")
(purple-dim-256 '"#d787af")
(purple '"#b978ab")
(purple-256 '"#af87af")
(blue-int '"#5689f0")
(blue-int-256 '"#5f87ff")
(blue-dim '"#64a3c3")
(blue-dim-256 '"#5fafaf")
(blue '"#4fb3d8")
(blue-256 '"#5fafd7")
(green-dim '"#69a559")
(green-dim-256 '"#87af5f")
(green-int '"#5ac85a")
(green-int-256 '"#5fd75f")
(green '"#78bd65")
(green-256 '"#87af5f")
(yellow-int '"#fedd38")
(yellow-int-256 '"#ffd75f")
(yellow-dim '"#897614")
(yellow-dim-256 '"#878700")
(yellow '"#e5cc51")
(yellow-256 '"#d7d75f")
(orange-int '"#f29858")
(orange-int-256 '"#ff875f")
(orange-dim '"#d68e5b")
(orange-dim-256 '"#d7875f")
(orange '"#ee7b29")
(orange-256 '"#ff8700")
(red-int '"#f43333")
(red-int-256 '"#ff5f5f")
(red-dim '"#d45364")
(red-dim-256 '"#d75f5f")
(red '"#ea3d54")
(red-256 '"#d75f5f")
(very-dark-grey '"#1c1d20")
(very-dark-grey-256 '"#1c1c1c")
(dark-grey '"#44464f")
(dark-grey-256 '"#5f5f87")
(grey '"#686b78")
(grey-256 '"#6c6c6c")
(light-grey '"#848794")
(light-grey-256 '"#8a8a8a")
(very-light-grey '"#cbccd1")
(very-light-grey-256 '"#d0d0d0")
(cls 't)
(tru '((type graphic) (min-colors 16777216)))
(gui '((type graphic))))
(custom-theme-set-faces 'an-old-hope
;;; defaults
`(default
((,tru (:foreground ,very-light-grey :background ,very-dark-grey))
;; let the terminal inherit its background from the terminals default.
(,cls (:foreground ,very-light-grey-256))))
`(italic ((,cls (:italic t :inherit default))))
`(underline ((,cls (:inherit default))))
`(shadow ((,cls (:foreground ,light-grey))))
`(hl-line ((,cls (:background ,line-highlight-bg))))
;;; font-lock - Syntax Highlighting Colors
`(font-lock-builtin-face ((,cls (:foreground ,blue))))
`(font-lock-comment-face ((,cls (:foreground ,grey))))
`(font-lock-keyword-face ((,cls (:foreground ,green-256))))
`(font-lock-constant-face ((,cls (:foreground ,red-256 :inherit bold))))
`(font-lock-function-name-face ((,cls (:foreground ,yellow-int-256))))
`(font-lock-negation-char-face ((,cls (:foreground ,red-256))))
`(font-lock-preprocessor-face ((,cls (:inherit font-lock-keyword-face))))
`(font-lock-string-face ((,cls (:foreground ,blue))))
`(font-lock-doc-face ((t (:foreground ,blue))))
`(font-lock-type-face ((,cls (:foreground ,red-256))))
`(font-lock-variable-name-face ((,cls (:foreground ,yellow-int-256))))
`(font-lock-warning-face ((,cls (:background ,yellow-int
:foreground ,very-dark-grey
:distant-foreground ,yellow-int
:underline nil :inherit bold))))
`(error ((,cls (:background ,red :distant-foreground ,red :foreground ,very-dark-grey :inherit bold))))
`(success ((,cls (:background ,green-int :distant-foreground ,green-int :foreground ,very-dark-grey :inherit bold))))
`(warning ((,cls (:background ,yellow-int :distant-foreground ,yellow-int :foreground ,very-dark-grey :inherit bold))))
`(cursor ((,cls (:background ,blue))))
`(custom-button ((,cls (:background ,very-dark-grey
:foreground ,very-light-grey
:box (:line-width 2 :style released-button)))))
;; Fringe has a different background on the GUI and the terminal, because the default bg
;; on the terminal is taken from the terminal bg. We apply a variant color for the fringe
;; on the terminal to make it distinctive.
`(fringe
((,gui (:background ,black))
(,cls (:background ,very-dark-grey))))
`(header-line ((,cls (:background ,very-dark-grey :foreground ,blue))))
`(line-number ((,cls (:foreground ,very-light-grey :inherit fringe))))
`(line-number-current-line ((,cls (:foreground ,blue :inherit line-number))))
`(vertical-border ((,cls (:foreground ,grey))))
`(internal-border ((,cls (:foreground ,white :background ,white))))
`(minibuffer-prompt ((,cls (:foreground ,yellow-256 :weight bold))))
`(highlight ((,cls (:foreground ,very-dark-grey :background ,blue
:distant-foreground ,blue :inherit bold))))
`(region ((,cls (:background ,dark-grey :weight bold))))
`(secondary-selection ((,cls (:inherit region))))
;; face for current search match. exiting now takes you to it.
`(isearch ((,cls (:background ,blue-int :inherit bold))))
`(isearch-fail ((,cls (:inherit compilation-mode-line-fail))))
`(match ((,cls (:foreground ,green-int))))
;; face for matches other than the current match
`(evil-ex-search ((,cls (:background ,purple :inherit bold))))
`(lazy-highlight ((,cls (:background ,blue-int :foreground ,black-dim))))
;; delimeter colors just taken from https://github.com/gastrodia/rainbow-brackets
;; colors 5-9 just recycle 1-4, maybe come up with more.
`(rainbow-delimiters-depth-1-face ((,cls (:foreground ,(nth 0 rainbow-delimeters-colors)))))
`(rainbow-delimiters-depth-2-face ((,cls (:foreground ,(nth 1 rainbow-delimeters-colors)))))
`(rainbow-delimiters-depth-3-face ((,cls (:foreground ,(nth 2 rainbow-delimeters-colors)))))
`(rainbow-delimiters-depth-4-face ((,cls (:foreground ,(nth 3 rainbow-delimeters-colors)))))
`(rainbow-delimiters-depth-5-face ((,cls (:foreground ,(nth 0 rainbow-delimeters-colors)))))
`(rainbow-delimiters-depth-6-face ((,cls (:foreground ,(nth 1 rainbow-delimeters-colors)))))
`(rainbow-delimiters-depth-7-face ((,cls (:foreground ,(nth 2 rainbow-delimeters-colors)))))
`(rainbow-delimiters-depth-8-face ((,cls (:foreground ,(nth 3 rainbow-delimeters-colors)))))
`(rainbow-delimiters-depth-9-face ((,cls (:foreground ,(nth 0 rainbow-delimeters-colors)))))
;; hyperlinks and path links
`(link ((,cls (:foreground ,blue))))
`(link-visited ((,cls (:foreground ,turquoise :inherit link))))
`(hl-todo ((,cls (:foreground ,yellow-int :inherit bold))))
;;; modeline
`(mode-line ((,cls
(:background ,very-light-grey :foreground ,very-dark-grey
:box (:line-width 1 :color ,very-light-grey :style none)))))
`(mode-line-inactive ((,cls
(:weight light :foreground "grey80" :background "grey30"
:box (:line-width 1 :color "grey40" :style none)))))
`(compilation-mode-line-fail ((,cls (:inherit bold :foreground ,red-dim))))
`(compilation-mode-line-run ((,cls (:inherit bold :foreground ,orange-dim))))
`(compilation-mode-line-exit ((,cls (:inherit bold :foreground ,green-dim))))
`(magit-mode-line-process-error ((,cls (:inherit compilation-mode-line-fail))))
;;; powerline
`(powerline-active1 ((,gui (:background ,black :foreground ,very-light-grey :inherit mode-line))
(,cls (:foreground ,very-light-grey :inherit default))))
`(powerline-active2 ((,cls (:inherit powerline-active1))))
`(powerline-inactive1 ((,cls (:box (:line-width 1 :color "grey40" :style none)
:inherit powerline-active1))))
;;; spaceline
`(spaceline-evil-normal ((,cls (:inherit mode-line :foreground ,very-dark-grey :background "DarkGoldenrod2"))))
`(spaceline-evil-insert ((,cls (:inherit mode-line :foreground ,very-dark-grey :background ,green-int-256))))
`(spaceline-evil-emacs ((,cls (:inherit mode-line :foreground ,very-dark-grey :background ,blue))))
`(spaceline-evil-replace ((,cls (:inherit mode-line :foreground ,very-dark-grey :background ,turquoise-int))))
`(spaceline-evil-visual ((,cls (:inherit mode-line :foreground ,very-light-grey :background ,dark-grey))))
`(spaceline-evil-motion ((,cls (:inherit mode-line :foreground ,very-dark-grey :background ,purple-int))))
`(spaceline-minibuffer ((,cls (:inherit mode-line :foreground ,very-dark-grey :background ,blue))))
`(spaceline-evil-operator ((,cls (:weight normal :inherit (error spaceline-evil-motion)))))
`(spaceline-flycheck-error ((,cls (:inherit compilation-mode-line-fail))))
`(spaceline-flycheck-warning ((,cls (:inherit compilation-mode-line-run))))
`(spaceline-flycheck-info ((,cls (:inherit compilation-mode-line-exit))))
;;; doom-modeline
`(doom-modeline-evil-normal-state ((,cls (:inherit mode-line :foreground ,very-dark-grey :background "DarkGoldenrod2"))))
`(doom-modeline-evil-insert-state ((,cls (:inherit mode-line :foreground ,very-dark-grey :background ,green-int-256))))
`(doom-modeline-evil-emacs-state ((,cls (:inherit mode-line :foreground ,very-dark-grey :background ,blue))))
`(doom-modeline-evil-replace-state ((,cls (:inherit mode-line :foreground ,very-dark-grey :background ,turquoise-int))))
`(doom-modeline-evil-visual-state ((,cls (:inherit mode-line :foreground ,very-light-grey :background ,dark-grey))))
`(doom-modeline-evil-motion-state ((,cls (:inherit mode-line :foreground ,very-dark-grey :background ,purple-int))))
`(doom-modeline-evil-operator-state ((,cls (:weight normal :inherit (error spaceline-evil-motion)))))
`(doom-modeline-buffer-modified ((,cls (:inherit doom-modeline-buffer-file))))
`(doom-modeline-lsp-error ((,cls (:inherit compilation-mode-line-fail))))
`(doom-modeline-lsp-warning ((,cls (:inherit compilation-mode-line-run))))
`(doom-modeline-lsp-success ((,cls ())))
`(doom-modeline-lsp-running ((,cls (:foreground ,blue-int :inherit compilation-mode-line-run))))
`(doom-modeline-urgent ((,cls (:inherit compilation-mode-line-fail))))
`(doom-modeline-debug ((,cls (:inherit compilation-mode-line-run))))
`(doom-modeline-info ((,cls (:inherit compilation-mode-line-exit))))
`(doom-modeline-buffer-minor-mode ((,cls (:foreground ,purple))))
;;; evil
`(vimish-fold-overlay ((,cls (:background ,dark-grey :foreground ,green))))
;;; flycheck
`(flycheck-fringe-info ((,cls (:foreground ,green-int :inherit fringe))))
`(flycheck-fringe-warning ((,cls (:foreground ,yellow-int :inherit fringe))))
`(flycheck-fringe-error ((,cls (:foreground ,red-int :inherit fringe))))
`(flycheck-info ((,cls (:underline (:style wave :color ,green)))))
`(flycheck-warning ((,cls (:underline (:style wave :color ,yellow)))))
`(flycheck-duplicate ((,cls (:underline (:style wave :color ,orange)))))
`(flycheck-error ((,gui (:underline (:style wave :color ,red)))
(,cls (:background ,red-256 :inherit error))))
;;; flymake
`(flymake-note ((,cls (:underline (:style wave :color ,green)))))
`(flymake-warning ((,cls (:underline (:style wave :color ,yellow)))))
`(flymake-error ((,gui (:underline (:style wave :color ,red)))
(,cls (:background ,red-256 :inherit error))))
;;; flyspell
`(flyspell-duplicate ((,cls (:foreground ,orange-dim :underline t))))
`(flyspell-incorrect ((,cls (:foreground ,red-dim :underline t))))
;;; avy
`(avy-background-face ((,cls (:foreground ,grey))))
`(avy-lead-face ((,cls (:background ,red-int :foreground ,white))))
`(avy-lead-face-0 ((,cls (:background ,blue-int :foreground ,white))))
`(avy-lead-face-1 ((,cls (:background ,very-light-grey :foreground ,very-dark-grey))))
`(avy-lead-face-2 ((,cls (:background ,purple-int :foreground ,white))))
`(frog-menu-border ((,cls (:background ,white :foreground ,white))))
`(frog-menu-posframe-background-face ((,cls (:background ,very-dark-grey))))
;;; company - intellisense
`(company-tooltip-mouse ((,cls (:foreground ,turquoise-int))))
`(company-template-field ((,cls (:foreground ,turquoise-int))))
;; scrollbar
`(company-scrollbar-bg ((,cls (:background ,very-light-grey :foreground ,very-light-grey))))
`(company-scrollbar-fg ((,cls (:background ,dark-grey :foreground ,dark-grey))))
`(company-preview ((,cls (:foreground ,blue-int :weight bold :inherit hl-line))))
`(company-preview-common ((,cls (:inherit company-preview))))
`(company-preview-search ((,cls (:foreground ,orange-int :weight normal :inherit company-preview))))
;; NOTE tooltip is the drop down menu which shows up when multiple results exist
`(company-tooltip ((,cls (:inherit bold :background ,very-light-grey :foreground ,very-dark-grey))))
`(company-tooltip-selection ((,cls (:foreground ,very-light-grey :background ,blue-int))))
`(company-tooltip-common ((,cls (:foreground ,blue-int :inherit company-tooltip))))
`(company-tooltip-common-selection ((,cls (:foreground ,very-dark-grey :background ,blue-int :inherit company-tooltip-common))))
`(company-tooltip-search ((,cls (:foreground ,orange :inherit company-tooltip))))
`(company-tooltip-search-common ((,cls (:inherit company-tooltip-search))))
`(company-tooltip-search-selection ((,cls (:background ,blue-int :inherit company-tooltip-search))))
;; NOTE annotations are extra information in the tooltip
`(company-tooltip-annotation ((,cls (:weight bold :foreground ,grey))))
`(company-tooltip-annotation-selection ((,cls (:foreground ,turquoise-int :background ,blue-int :inherit company-tooltip-annotation))))
`(popup ((,cls (:inherit popup-face))))
;;;; custom mode variants
;;; whitespace-mode
`(whitespace-space ((,cls (:foreground ,dark-grey))))
`(trailing-whitespace ((,cls (:background ,dark-grey))))
;;; auto-highlight-symbol mode
;; NOTE: distant foreground is meaningless here because the faces are always given priority.
`(ahs-definition-face ((,cls (:background ,blue-dim :distant-foreground ,blue-dim :foreground ,dark-grey))))
`(ahs-edit-mode-face ((,cls (:background ,red-dim :distant-foreground ,red-dim :foreground ,very-light-grey))))
`(ahs-face ((,cls (:background ,very-light-grey :foreground ,black :inherit bold))))
`(ahs-plugin-whole-buffer-face ((,cls (:background ,blue :distant-foreground ,green :foreground ,black))))
`(ahs-plugin-bod-face ((,cls (:background ,blue-int :distant-foreground ,blue-int :foreground ,black))))
`(ahs-plugin-defalt-face ((,cls (:background ,orange-dim :distant-foreground ,orange-dim :foreground ,black))))
`(ahs-warning-face ((,cls (:foreground ,red-dim))))
;;; compilation mode
`(compilation-line-number ((,cls (:foreground ,yellow))))
`(compilation-column-number ((,cls (:inherit font-lock-doc-face))))
;; NOTE also represents value count in mode line
`(compilation-error ((,cls (:foreground ,red :inherit bold))))
`(compilation-info ((,cls (:foreground ,green-int :inherit bold))))
`(compilation-warning ((,cls (:foreground ,orange-int :inherit bold))))
;;; markdown-mode
`(markdown-code-face ((,cls (:inherit default))))
;;; anzu
`(anzu-mode-line ((,cls (:foreground ,very-dark-grey :inherit bold))))
`(anzu-mode-line-no-match ((,cls (:foreground ,red-int :inherit bold))))
;;; hydra-posframe
;; for some reason... if hydra-posframe-face inherits default, internal border won't work
`(hydra-posframe-face ((,cls (:background ,very-dark-grey :foreground ,very-light-grey))))
`(hydra-posframe-border-face ((,cls (:inherit internal-border))))
;;; selectrum
`(selectrum-current-candidate ((,cls (:foreground ,very-dark-grey :font-weight 'normal :inherit highlight))))
`(selectrum-primary-highlight ((,cls (:background "#555555"))))
`(selectrum-secondary-highlight ((,cls (:background "#7777FF")))) ;; #8A498A
;;; ivy
;; by default, it seems if ivy-highlight-face has its own spec, it'll interfere
;; with the face of ivy-current-match. Which'll make it harder to tell which
;; candidate is the current candidate.
;;
;; If ivy-highlight-face just inherits another face, then when both it and
;; ivy-current-match are applied to a string, ivy-current-match will override
;; ivy-highlight-face. Thus, this.
`(ivy-actual-highlight-face ((,cls (:foreground ,very-dark-grey :background ,turquoise
:distant-foreground ,turquoise :inherit bold))))
`(ivy-highlight-face ((,cls (:inherit ivy-actual-highlight-face))))
`(ivy-current-match ((,cls (:foreground ,very-dark-grey :font-weight 'normal :inherit highlight))))
;;; org-mode
`(org-link ((,cls (:inherit (link bold)))))
`(org-footnote ((,cls (:foreground ,blue))))
;; Overridden by hl-todo-keyword-faces
`(org-todo ((,cls (:foreground ,purple-int :inherit bold))))
`(org-done ((,cls (:foreground ,green-int :inherit bold))))
`(org-upcoming-deadline ((,cls (:foreground ,red-dim))))
`(org-warning ((,cls (:foreground ,orange :inherit bold))))
`(org-scheduled-today ((,cls (:foreground ,green-int))))
`(org-block-begin-line ((,cls (:background "royalblue4" :distant-foreground "royalblue4" :foreground "steelblue1" :extend t))))
`(org-meta-line ((,cls (:inherit font-lock-comment-face))))
`(org-block ((,cls (:background ,extra-dark-grey :extend t))))
`(org-document-title ((,cls (:foreground ,white :height 1.3 :inherit bold))))
;;; rust[ic]-mode
`(rustic-compilation-warning ((,cls (:inherit compilation-warning))))
`(rustic-compilation-info ((,cls (:inherit compilation-info))))
`(rustic-compilation-error ((,cls (:inherit compilation-error))))
`(rustic-compilation-column ((,cls (:inherit compilation-column-number))))
`(rustic-compilation-line ((,cls (:inherit compilation-line-number))))
;;; dashboard
`(dashboard-text-banner ((,cls (:foreground ,orange-int))))
`(dashboard-items-face ((,cls (:font-weight 'normal))))
`(dashboard-no-items-face ((,cls (:font-weight 'normal))))
`(dashboard-heading ((,cls (:inherit (bold dashboard-navigator)))))
;;; eshell-prompt-extras
`(epe-remote-face ((,cls (:foreground ,turquoise))))
`(epe-venv-face ((,cls (:foreground ,purple))))
;;; typescript
`(typescript-primitive-face ((,cls (:inherit font-lock-type-face))))
;;; latex
`(font-latex-sedate-face ((,cls (:inherit font-lock-keyword-face))))
`(font-latex-sectioning-0-face ((,cls (:inherit font-lock-function-name-face))))
`(font-latex-sectioning-1-face ((,cls (:inherit font-lock-function-name-face))))
`(font-latex-sectioning-2-face ((,cls (:inherit font-lock-function-name-face))))
`(font-latex-sectioning-3-face ((,cls (:inherit font-lock-function-name-face))))
`(font-latex-sectioning-4-face ((,cls (:inherit font-lock-function-name-face))))
`(font-latex-sectioning-5-face ((,cls (:inherit font-lock-function-name-face))))
;;; man/woman
`(Man-underline ((,cls (:foreground ,green-int :inherit bold))))
`(woman-addition ((,cls (:foreground ,purple))))
`(woman-bold ((,cls (:foreground ,red :inherit bold))))
`(woman-italic ((,cls (:foreground ,green))))
`(woman-unknown ((,cls (:inherit error))))
;;; vline
`(vline ((,cls (:inherit hl-line))))
`(vline-visual ((,cls (:inherit hl-line))))
;;; marginalia
`(marginalia-documentation ((,cls (:inherit font-lock-comment-face))))
)
(custom-theme-set-variables 'an-old-hope
`(hl-todo-keyword-faces
'(("TODO" ,red)
("NEXT" ,red)
("RANT" ,red)
("SEE" ,red)
("SKIP" ,red)
("LATE" ,red)
("THEM" ,purple)
("PROG" ,blue-int)
("OKAY" ,blue-int)
("DONT" ,green-int)
("FAIL" ,red)
("DONE" ,green-int)
("NOTE" ,yellow-int)
("WAIT" ,yellow-int)
("KLUDGE" ,yellow-int)
("HACK" ,yellow-int)
("TEMP" ,yellow-int)
("FIXME" ,orange)
("WARN" ,orange)
("XXX+" ,orange)
("\\?\\?\\?+" ,orange))))
)
;; an old hope:5 ends here
;; [[file:~/.config/emacs/init.org::*an old hope][an old hope:6]]
(provide-theme 'an-old-hope)
;; an old hope:6 ends here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment