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

Use display-color-cells to enable 24-bit color terminal support #64

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 53 additions & 31 deletions nord-theme.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -450,6 +454,11 @@
`(web-mode-variable-name-face ((,class (:foreground ,nord-variable))))

;; +--- UI ---+

;; > ace-jump-mode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this additional style block and maybe submit a new PR if you'd like to add support for the package to Nord.

`(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))))
Expand Down Expand Up @@ -480,6 +489,19 @@
`(diff-hl-change ((,class (:background ,nord13))))
`(diff-hl-insert ((,class (:background ,nord14))))
`(diff-hl-delete ((,class (:background ,nord11))))

;; > diredp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same like above: Please also remove this additional style block.

`(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))))
Expand Down