From d7b30d7f4a613e2bbe90ac0ab2665b0b69f437b7 Mon Sep 17 00:00:00 2001 From: Shaheen Gandhi Date: Sat, 28 Jul 2018 23:57:30 +0100 Subject: [PATCH 1/3] Use `display-color-cells` to enable 24-bit color terminal support --- nord-theme.el | 66 +++++++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/nord-theme.el b/nord-theme.el index 6cf445b..6213f69 100644 --- a/nord-theme.el +++ b/nord-theme.el @@ -77,39 +77,43 @@ (nth percent nord-brightened-comments) (nth 0 nord-brightened-comments))) +(defun nord-display-truecolor-or-graphic-p () + "Returns whether the display can display nord colors" + (or (= (display-color-cells) 16777216) (display-graphic-p))) + ;;;; Color Constants (let ((class '((class color) (min-colors 89))) - (nord0 (if (display-graphic-p) "#2E3440" nil)) - (nord1 (if (display-graphic-p) "#3B4252" "black")) - (nord2 (if (display-graphic-p) "#434C5E" "#434C5E")) - (nord3 (if (display-graphic-p) "#4C566A" "brightblack")) - (nord4 (if (display-graphic-p) "#D8DEE9" "#D8DEE9")) - (nord5 (if (display-graphic-p) "#E5E9F0" "white")) - (nord6 (if (display-graphic-p) "#ECEFF4" "brightwhite")) - (nord7 (if (display-graphic-p) "#8FBCBB" "cyan")) - (nord8 (if (display-graphic-p) "#88C0D0" "brightcyan")) - (nord9 (if (display-graphic-p) "#81A1C1" "blue")) - (nord10 (if (display-graphic-p) "#5E81AC" "brightblue")) - (nord11 (if (display-graphic-p) "#BF616A" "red")) - (nord12 (if (display-graphic-p) "#D08770" "brightyellow")) - (nord13 (if (display-graphic-p) "#EBCB8B" "yellow")) - (nord14 (if (display-graphic-p) "#A3BE8C" "green")) - (nord15 (if (display-graphic-p) "#B48EAD" "magenta")) - (nord-annotation (if (display-graphic-p) "#D08770" "brightyellow")) - (nord-attribute (if (display-graphic-p) "#8FBCBB" "cyan")) - (nord-class (if (display-graphic-p) "#8FBCBB" "cyan")) - (nord-comment (if (display-graphic-p) (brightened-comment-color nord-comment-brightness) "brightblack")) - (nord-escape (if (display-graphic-p) "#D08770" "brightyellow")) - (nord-method (if (display-graphic-p) "#88C0D0" "brightcyan")) - (nord-keyword (if (display-graphic-p) "#81A1C1" "blue")) - (nord-numeric (if (display-graphic-p) "#B48EAD" "magenta")) - (nord-operator (if (display-graphic-p) "#81A1C1" "blue")) - (nord-preprocessor (if (display-graphic-p) "#5E81AC" "brightblue")) - (nord-punctuation (if (display-graphic-p) "#D8DEE9" "#D8DEE9")) - (nord-regexp (if (display-graphic-p) "#EBCB8B" "yellow")) - (nord-string (if (display-graphic-p) "#A3BE8C" "green")) - (nord-tag (if (display-graphic-p) "#81A1C1" "blue")) - (nord-variable (if (display-graphic-p) "#D8DEE9" "#D8DEE9")) + (nord0 (if (nord-display-truecolor-or-graphic-p) "#2E3440" nil)) + (nord1 (if (nord-display-truecolor-or-graphic-p) "#3B4252" "black")) + (nord2 (if (nord-display-truecolor-or-graphic-p) "#434C5E" "#434C5E")) + (nord3 (if (nord-display-truecolor-or-graphic-p) "#4C566A" "brightblack")) + (nord4 (if (nord-display-truecolor-or-graphic-p) "#D8DEE9" "#D8DEE9")) + (nord5 (if (nord-display-truecolor-or-graphic-p) "#E5E9F0" "white")) + (nord6 (if (nord-display-truecolor-or-graphic-p) "#ECEFF4" "brightwhite")) + (nord7 (if (nord-display-truecolor-or-graphic-p) "#8FBCBB" "cyan")) + (nord8 (if (nord-display-truecolor-or-graphic-p) "#88C0D0" "brightcyan")) + (nord9 (if (nord-display-truecolor-or-graphic-p) "#81A1C1" "blue")) + (nord10 (if (nord-display-truecolor-or-graphic-p) "#5E81AC" "brightblue")) + (nord11 (if (nord-display-truecolor-or-graphic-p) "#BF616A" "red")) + (nord12 (if (nord-display-truecolor-or-graphic-p) "#D08770" "brightyellow")) + (nord13 (if (nord-display-truecolor-or-graphic-p) "#EBCB8B" "yellow")) + (nord14 (if (nord-display-truecolor-or-graphic-p) "#A3BE8C" "green")) + (nord15 (if (nord-display-truecolor-or-graphic-p) "#B48EAD" "magenta")) + (nord-annotation (if (nord-display-truecolor-or-graphic-p) "#D08770" "brightyellow")) + (nord-attribute (if (nord-display-truecolor-or-graphic-p) "#8FBCBB" "cyan")) + (nord-class (if (nord-display-truecolor-or-graphic-p) "#8FBCBB" "cyan")) + (nord-comment (if (nord-display-truecolor-or-graphic-p) (brightened-comment-color nord-comment-brightness) "brightblack")) + (nord-escape (if (nord-display-truecolor-or-graphic-p) "#D08770" "brightyellow")) + (nord-method (if (nord-display-truecolor-or-graphic-p) "#88C0D0" "brightcyan")) + (nord-keyword (if (nord-display-truecolor-or-graphic-p) "#81A1C1" "blue")) + (nord-numeric (if (nord-display-truecolor-or-graphic-p) "#B48EAD" "magenta")) + (nord-operator (if (nord-display-truecolor-or-graphic-p) "#81A1C1" "blue")) + (nord-preprocessor (if (nord-display-truecolor-or-graphic-p) "#5E81AC" "brightblue")) + (nord-punctuation (if (nord-display-truecolor-or-graphic-p) "#D8DEE9" "#D8DEE9")) + (nord-regexp (if (nord-display-truecolor-or-graphic-p) "#EBCB8B" "yellow")) + (nord-string (if (nord-display-truecolor-or-graphic-p) "#A3BE8C" "green")) + (nord-tag (if (nord-display-truecolor-or-graphic-p) "#81A1C1" "blue")) + (nord-variable (if (nord-display-truecolor-or-graphic-p) "#D8DEE9" "#D8DEE9")) (nord-region-highlight-foreground (if (or (string= nord-region-highlight "frost") (string= nord-region-highlight "snowstorm")) "#2E3440" nil)) From 449f6429002d0c81bdebcf9527f6eee0e3e83915 Mon Sep 17 00:00:00 2001 From: Shaheen Gandhi Date: Mon, 30 Jul 2018 22:19:39 +0100 Subject: [PATCH 2/3] Add diredp faces --- nord-theme.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/nord-theme.el b/nord-theme.el index 6213f69..2e20f8a 100644 --- a/nord-theme.el +++ b/nord-theme.el @@ -454,6 +454,7 @@ `(web-mode-variable-name-face ((,class (:foreground ,nord-variable)))) ;; +--- UI ---+ + ;; > Anzu `(anzu-mode-line ((,class (:foreground, nord8)))) `(anzu-mode-line-no-match ((,class (:foreground, nord11)))) @@ -484,6 +485,19 @@ `(diff-hl-change ((,class (:background ,nord13)))) `(diff-hl-insert ((,class (:background ,nord14)))) `(diff-hl-delete ((,class (:background ,nord11)))) + + ;; > diredp + `(diredp-dir-heading ((,class (:underline t :foreground ,nord9 :weight bold)))) + `(diredp-dir-priv ((,class (:foreground ,nord10)))) + `(diredp-exec-priv ((,class (:foreground ,nord14)))) + `(diredp-file-name ((,class (:inherit default)))) + `(diredp-file-suffix ((,class (:inherit default)))) + `(diredp-inode+size ((,class (:foreground ,nord8)))) + `(diredp-no-priv ((,class (:inherit default)))) + `(diredp-other-priv ((,class (:foreground ,nord13)))) + `(diredp-rare-priv ((,class (:foreground ,nord12)))) + `(diredp-read-priv ((,class (:foreground ,nord5)))) + `(diredp-write-priv ((,class (:foreground ,nord11)))) ;; > Evil `(evil-ex-info ((,class (:foreground ,nord8)))) From 4f1cdf095a0c99c926fcf296dd6b4f8db1e4ee57 Mon Sep 17 00:00:00 2001 From: Shaheen Gandhi Date: Mon, 30 Jul 2018 22:34:37 +0100 Subject: [PATCH 3/3] Add ace-jump-mode faces --- nord-theme.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nord-theme.el b/nord-theme.el index 2e20f8a..03067cf 100644 --- a/nord-theme.el +++ b/nord-theme.el @@ -455,6 +455,10 @@ ;; +--- UI ---+ + ;; > ace-jump-mode + `(ace-jump-face-background ((,class (:foreground ,nord4)))) + `(ace-jump-face-foreground ((,class (:foreground ,nord15)))) + ;; > Anzu `(anzu-mode-line ((,class (:foreground, nord8)))) `(anzu-mode-line-no-match ((,class (:foreground, nord11))))