Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

theme: add kanagawa #790

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ welcome PRs to help us maintain and address inconsistencies in them.
| doom-horizon | [link](https://github.com/aodhneine/horizon-theme.el) | ported from VSCode Horizon (ported by [@karetsu](https://github.com/karetsu)) |
| doom-Iosvkem | [link](https://github.com/neutaaaaan/iosvkem) | ported from the default dark theme for Adobe Brackets (ported by [@neutaaaaan](https://github.com/neutaaaaan)) |
| doom-ir-black | [link](https://github.com/twerth/ir_black) | ported from Vim's ir_black colorscheme (ported by [@legendre6891](https://github.com/legendre6891)) |
| doom-kanagawa | [link](https://github.com/rebelot/kanagawa.nvim) | based on rebelot's neovim colorscheme (ported py [@Anskrevy](https://github.com/Anskrevy)) |
| doom-lantern | [link](https://github.com/Gitleptune/lantern-theme) | based on Gitleptune's Lantern theme (ported by [@paladhammika](https://github.com/paladhammika)) |
| doom-laserwave | [link](https://github.com/Jaredk3nt/laserwave) | a clean synthwave/outrun theme inspired by VSCode's Laserwave (ported by [@hyakt](https://github.com/hyakt)) |
| doom-manegarm | original | an original autumn-inspired dark theme (ported by [@kenranunderscore](https://github.com/kenranunderscore)) |
Expand Down Expand Up @@ -122,7 +123,7 @@ welcome PRs to help us maintain and address inconsistencies in them.
| doom-outrun-electric | [link](https://github.com/samrap/outrun-theme-vscode) | a high contrast, neon theme inspired by Outrun Electric on VSCode (ported by [@ema2159](https://github.com/ema2159)) |
| doom-palenight | [link](https://github.com/equinusocio/vsc-material-theme) | adapted from equinusocio's Material themes (ported by [@Brettm12345](https://github.com/Brettm12345)) |
| doom-peacock | [link](https://github.com/daylerees/colour-schemes/blob/master/emacs/peacock-theme.el) | inspired by daylerees' Peacock (ported by [@teesloane](https://github.com/teesloane)) |
| doom-pine | [link](https://github.com/morhetz/gruvbox) | a green-tinged Gruvbox (by [@RomanHargrave](https://github.com/RomanHargrave)) |
| doom-pine | [link](https://github.com/morhetz/gruvbox) | a green-tinged Gruvbox (by [@RomanHargrave](https://github.com/RomanHargrave)) |
| doom-plain | [link](https://github.com/gko/plain/) | inspired by gko's plain theme for VSCode (ported by [@das-s](https://github.com/das-s)) |
| doom-plain-dark | [link](https://github.com/gko/plain/) | inspired by gko's plain theme for VSCode (ported by [@das-s](https://github.com/das-s)) |
| doom-rouge | [link](https://github.com/josefaidt/rouge-theme) | ported from VSCode's Rouge Theme (ported by [@das-s](https://github.com/das-s)) |
Expand Down
178 changes: 178 additions & 0 deletions themes/doom-kanagawa-theme.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
;;; doom-kanagawa-theme.el --- inspired by rebelot/kanagawa.nvim and others -*- lexical-binding: t; no-byte-compile: t; -*-
;;
;; Added: June 4 2023
;; Author: Anskrevy <https://github.com/Anskrevy
;; Maintainer:
;; Source: ????
;;
;;; Commentary:
;;; Original theme by rebelot see: https://github.com/rebelot/kanagawa.nvim
;;; Inspiration taken from modified version in https://github.com/NvChad/base46
;;; and konrad1977 https://github.com/konrad1977/emacs .
;;; fi
;;
;;; Code:

(require 'doom-themes)


;;
;;; Variables

(defgroup doom-kanagawa-theme nil
"Options for the `doom-kanagawa' theme."
:group 'doom-themes)

(defcustom doom-kanagawa-brighter-modeline nil
"If non-nil, more vivid colors will be used to style the mode-line."
:group 'doom-kanagawa-theme
:type 'boolean)

(defcustom doom-kanagawa-brighter-comments nil
"If non-nil, comments will be highlighted in more vivid colors."
:group 'doom-kanagawa-theme
:type 'boolean)

(defcustom doom-kanagawa-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-kanagawa-theme
:type '(choice integer boolean))


;;
;;; Theme definition

(def-doom-theme doom-kanagawa
"A dark theme inspired by rebelot/kanagawa.nvim and others."

;; name default 256 16
((bg '("#1d1c1c" "black" "black" ))
(fg '("#DCD7BA" "#DCD7BA" "brightwhite" ))

;; These are off-color variants of bg/fg, used primarily for `solaire-mode',
;; but can also be useful as a basis for subtle highlights (e.g. for hl-line
;; or region), especially when paired with the `doom-darken', `doom-lighten',
;; and `doom-blend' helper functions.
(bg-alt '("#181616" "black" "black" ))
(fg-alt '("#C8C093" "#C8C093" "white" ))

;; These should represent a spectrum from bg to fg, where base0 is a starker
;; bg and base8 is a starker fg. For example, if bg is light grey and fg is
;; dark grey, base0 should be white and base8 should be black.
(base0 '("#191922" "black" "black" ))
(base1 '("#28282E" "#28282E" "brightblack" ))
(base2 '("#222129" "#222129" "brightblack" ))
(base3 '("#26252C" "#26252C" "brightblack" ))
(base4 '("#37363A" "#37363A" "brightblack" ))
(base5 '("#464546" "#464546" "brightblack" ))
(base6 '("#545451" "#545451" "brightblack" ))
(base7 '("#727169" "#727169" "brightblack" ))
(base8 '("#BABDB9" "#BABDB9" "white" ))

(grey base4)
(red '("#d8616b" "#d8616b" "red" ))
(orange '("#ffa066" "#ffa066" "brightred" ))
(green '("#98bb6c" "#98bb6c" "green" ))
(teal '("#7AA89F" "#7AA89F" "brightgreen" ))
(yellow '("#E6C384" "#E6C384" "yellow" ))
(blue '("#7FB4CA" "#7FB4CA" "brightblue" ))
(dark-blue '("#7E9CD8" "#7E9CD8" "blue" ))
(magenta '("#957FB8" "#957FB8" "brightmagenta"))
(violet '("#aaa1c8" "#aaa1c8" "magenta" ))
(cyan '("#A3D4D5" "#A3D4D5" "brightcyan" ))
(dark-cyan '("#658594" "#658594" "cyan" ))

;; These are the "universal syntax classes" that doom-themes establishes.
;; These *must* be included in every doom themes, or your theme will throw an
;; error, as they are used in the base theme defined in doom-themes-base.
(highlight blue)
(vertical-bar (doom-darken base1 0.1))
(selection (doom-darken dark-blue 0.5))
(builtin magenta)
(comments (if doom-kanagawa-brighter-comments dark-cyan base5))
(doc-comments (doom-lighten (if doom-kanagawa-brighter-comments dark-cyan base5) 0.25))
(constants violet)
(functions magenta)
(keywords blue)
(methods cyan)
(operators blue)
(type yellow)
(strings green)
(variables (doom-lighten magenta 0.4))
(numbers orange)
(region `(,(doom-lighten (car bg-alt) 0.15) ,@(doom-lighten (cdr base1) 0.35)))
(error red)
(warning yellow)
(success green)
(vc-modified orange)
(vc-added green)
(vc-deleted red)

;; These are extra color variables used only in this theme; i.e. they aren't
;; mandatory for derived themes.
(modeline-fg fg)
(modeline-fg-alt base5)
(modeline-bg (if doom-kanagawa-brighter-modeline
(doom-darken blue 0.45)
(doom-darken bg-alt 0.1)))
(modeline-bg-alt (if doom-kanagawa-brighter-modeline
(doom-darken blue 0.475)
`(,(doom-darken (car bg-alt) 0.15) ,@(cdr bg))))
(modeline-bg-inactive `(,(car bg-alt) ,@(cdr base1)))
(modeline-bg-inactive-alt `(,(doom-darken (car bg-alt) 0.1) ,@(cdr bg)))

(-modeline-pad
(when doom-kanagawa-padded-modeline
(if (integerp doom-kanagawa-padded-modeline) doom-kanagawa-padded-modeline 4))))


;;;; Base theme face overrides
(((line-number &override) :foreground base4)
((line-number-current-line &override) :foreground fg)
((font-lock-comment-face &override)
:background (if doom-kanagawa-brighter-comments (doom-lighten bg 0.05)))
(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 (if doom-kanagawa-brighter-modeline base8 highlight))

;;;; css-mode <built-in> / scss-mode
(css-proprietary-property :foreground orange)
(css-property :foreground green)
(css-selector :foreground blue)
;;;; doom-modeline
(doom-modeline-bar :background (if doom-kanagawa-brighter-modeline modeline-bg highlight))
(doom-modeline-buffer-file :inherit 'mode-line-buffer-id :weight 'bold)
(doom-modeline-buffer-path :inherit 'mode-line-emphasis :weight 'bold)
(doom-modeline-buffer-project-root :foreground green :weight 'bold)
;;;; elscreen
(elscreen-tab-other-screen-face :background "#353a42" :foreground "#1e2022")
;;;; ivy
(ivy-current-match :background dark-blue :distant-foreground base0 :weight 'normal)
;;;; LaTeX-mode
(font-latex-math-face :foreground green)
;;;; markdown-mode
(markdown-markup-face :foreground base5)
(markdown-header-face :inherit 'bold :foreground red)
((markdown-code-face &override) :background (doom-lighten base3 0.05))
;;;; rjsx-mode
(rjsx-tag :foreground red)
(rjsx-attr :foreground orange)
;;;; 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))))

;;;; Base theme variable overrides-
())

;;; doom-kanagawa-theme.el ends here