branch: elpa/dracula-theme
commit 747948e7cfd9f2373111c3f26e642166c487824a
Author: Étienne Deparis <[email protected]>
Commit: Étienne Deparis <[email protected]>
Add support for ansi-color-names-vector
Fixes: https://github.com/dracula/emacs/issues/75
---
dracula-theme.el | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/dracula-theme.el b/dracula-theme.el
index d35f1f1..e49ea6d 100644
--- a/dracula-theme.el
+++ b/dracula-theme.el
@@ -786,8 +786,24 @@ read it before opening a new issue about your will.")
(t ; should be only tty-like envs
,(funcall expand-with-func 'cadddr spec))))
whole-theme))
- whole-theme)))
+ whole-theme))
+ (apply #'custom-theme-set-variables
+ 'dracula
+ (let ((get-func
+ (pcase (display-color-cells)
+ ((pred (<= 16777216)) 'car) ; fully graphical envs
+ ((pred (<= 256)) 'cadr) ; terminal withs 256 colors
+ (_ 'caddr)))) ; should be only tty-like envs
+ `((ansi-color-names-vector
+ [,(funcall get-func (alist-get 'dracula-bg colors))
+ ,(funcall get-func (alist-get 'dracula-red colors))
+ ,(funcall get-func (alist-get 'dracula-green colors))
+ ,(funcall get-func (alist-get 'dracula-yellow colors))
+ ,(funcall get-func (alist-get 'dracula-comment colors))
+ ,(funcall get-func (alist-get 'dracula-purple colors))
+ ,(funcall get-func (alist-get 'dracula-cyan colors))
+ ,(funcall get-func (alist-get 'dracula-fg colors))])))))
;;;###autoload