From cf17b90c16a5fee487f35a3139f44295d497043f Mon Sep 17 00:00:00 2001 From: jao Date: Sun, 20 Oct 2019 00:03:36 +0100 Subject: themes: support for named colors --- themes/jao-themes.el | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/themes/jao-themes.el b/themes/jao-themes.el index 04b6241..c494192 100644 --- a/themes/jao-themes.el +++ b/themes/jao-themes.el @@ -116,11 +116,15 @@ (defvar jao-themes--cidxs nil) (defvar jao-themes--x-colors nil) +(defvar *jao-themes--color-names* nil) + (defun jao-themes--color (clr) (cond ((stringp clr) clr) ((numberp clr) (or (nth clr jao-themes--cidxs) (nth clr jao-themes--default-cidxs) (format "color-%s" clr))) + ((symbolp clr) (or (cadr (assoc clr *jao-themes--color-names*)) + 'unspecified)) (t 'unspecified))) (defun jao-themes--parse-face-sym (s) @@ -152,6 +156,7 @@ (ul '(:underline t)) (nul '(:underline nil)) (st '(:strike-through t)) + (ex '(:extend t)) (bx `(:box (:line-width -1 :color ,jao-themes--box))) (t (list s)))))) @@ -245,6 +250,7 @@ (cider-test-success-face (p f01)) (comint-highlight-input (p f01) nbf) (comint-highlight-prompt (p f00)) + (clojure-keyword-face (p keyword)) (company-echo-common (p warning)) (company-scrollbar-bg (p hilite)) (company-scrollbar-fg (p warning)) @@ -579,14 +585,14 @@ (isearch-fail (p error)) (italic (p italic)) (ivy-confirm (p f01)) - (ivy-current-match (p error) ul) + (ivy-current-match (p warning)) (ivy-highlight-face (p hilite)) (ivy-match-required-face (p warning)) (ivy-minibuffer-match-highlight (c nil nil) ul) - (ivy-minibuffer-match-face-1 (p f00) ul) - (ivy-minibuffer-match-face-2 (p f00) ul) - (ivy-minibuffer-match-face-3 (p f00) ul) - (ivy-minibuffer-match-face-4 (p f00) ul) + (ivy-minibuffer-match-face-1 (p f00)) + (ivy-minibuffer-match-face-2 (p f00)) + (ivy-minibuffer-match-face-3 (p f00)) + (ivy-minibuffer-match-face-4 (p f00)) (ivy-modified-buffer bf) (ivy-subdir (p f12))) `((jabber-activity-face dbg dfg nbf) @@ -629,11 +635,13 @@ (link link nul) (link-visited vlink nul) (lui-button-face (p link)) + (lui-highlight-face (p warning)) (lui-time-stamp-face (p dimm)) (lui-track-bar (c nil "gray90") :height 0.1)) `((magit-branch (p f00)) (magit-cherry-equivalent (p warning)) (magit-diff-add (~ diff-added)) + (magit-diff-added-highlight (~ diff-added) ex) (magit-diff-context-highlight (p hilite)) (magit-diff-del (~ diff-removed)) (magit-diff-file-heading (p keyword)) @@ -641,7 +649,7 @@ (magit-diff-hunk-header (~ diff-hunk-header)) (magit-diff-none (p dimm)) (magit-hash (p f12)) - (magit-item-highlight (~ mm-uu-extract)) + (magit-item-highlight (~ mm-uu-extract) ex) (magit-item-mark (p warning)) (magit-log-head-label (p keyword) bf) (magit-log-head-label-head (p keyword) nbf ul) @@ -915,16 +923,17 @@ (ansi-color-map-update 'ansi-color-names-vector ,ansi-colors) (custom-make-theme-feature ',name) (deftheme ,name) - (let* ,(jao-themes--let-palette palette nil) - (jao-themes--set-fbg nil) - (let ((,t-faces (jao-themes--make-faces ',faces))) - (let* ,(jao-themes--let-palette palette t) - (jao-themes--set-fbg 'x) - (let* ((,xfaces (jao-themes--make-faces ',x-faces ',x-colors)) - (,tx-faces (jao-themes--extract-faces ,t-faces ,xfaces))) - (put ',name 'theme-immediate t) - (apply 'custom-theme-set-faces (cons ',name ,tx-faces))))) - (provide-theme ',name))))) + (let ((*jao-themes--color-names* ',(cdr (assoc :names args)))) + (let* ,(jao-themes--let-palette palette nil) + (jao-themes--set-fbg nil) + (let ((,t-faces (jao-themes--make-faces ',faces))) + (let* ,(jao-themes--let-palette palette t) + (jao-themes--set-fbg 'x) + (let* ((,xfaces (jao-themes--make-faces ',x-faces ',x-colors)) + (,tx-faces (jao-themes--extract-faces ,t-faces ,xfaces))) + (put ',name 'theme-immediate t) + (apply 'custom-theme-set-faces (cons ',name ,tx-faces))))) + (provide-theme ',name)))))) (put 'jao-define-custom-theme 'lisp-indent-function 1) -- cgit v1.2.3