emacs: ef-themes workaround

This commit is contained in:
Pavel Korytov 2025-11-12 18:22:54 +03:00
parent 6328304e70
commit cbd5ff7b0c
2 changed files with 13 additions and 8 deletions

View file

@ -138,8 +138,10 @@
(defun my/modus-get-base (color)
(let ((base-value (string-to-number (substring (symbol-name color) 4 5)))
(base-start (cadr (assoc 'bg-main (modus-themes-get-theme-palette))))
(base-end (cadr (assoc 'fg-dim (modus-themes-get-theme-palette)))))
(base-start (cadr (assoc 'bg-main (modus-themes-get-theme-palette
(or (my/modus-p) (my/ef-p))))))
(base-end (cadr (assoc 'fg-dim (modus-themes-get-theme-palette
(or (my/modus-p) (my/ef-p)))))))
(nth base-value (ct-gradient 9 base-start base-end t))))
(defun my/prot-color (color palette)
@ -179,10 +181,10 @@
(t (cadr (assoc color palette))))))
(defun my/modus-color (color)
(my/prot-color color (modus-themes-get-theme-palette)))
(my/prot-color color (modus-themes-get-theme-palette (my/modus-p))))
(defun my/ef-color (color)
(my/prot-color color (modus-themes-get-theme-palette)))
(my/prot-color color (modus-themes-get-theme-palette (my/ef-p))))
(defconst my/test-colors-list
'(black red green yellow blue magenta cyan white light-black
@ -276,6 +278,7 @@
(eq enabled-theme theme)))
do (disable-theme enabled-theme))
(load-theme theme t)
(my/update-my-theme)
(when current-prefix-arg
(my/regenerate-desktop)))

View file

@ -2436,8 +2436,10 @@ And the same for =modus-themes=. =my/modus-color= has to accept the same argumen
#+begin_src emacs-lisp
(defun my/modus-get-base (color)
(let ((base-value (string-to-number (substring (symbol-name color) 4 5)))
(base-start (cadr (assoc 'bg-main (modus-themes-get-theme-palette))))
(base-end (cadr (assoc 'fg-dim (modus-themes-get-theme-palette)))))
(base-start (cadr (assoc 'bg-main (modus-themes-get-theme-palette
(or (my/modus-p) (my/ef-p))))))
(base-end (cadr (assoc 'fg-dim (modus-themes-get-theme-palette
(or (my/modus-p) (my/ef-p)))))))
(nth base-value (ct-gradient 9 base-start base-end t))))
(defun my/prot-color (color palette)
@ -2477,10 +2479,10 @@ And the same for =modus-themes=. =my/modus-color= has to accept the same argumen
(t (cadr (assoc color palette))))))
(defun my/modus-color (color)
(my/prot-color color (modus-themes-get-theme-palette)))
(my/prot-color color (modus-themes-get-theme-palette (my/modus-p))))
(defun my/ef-color (color)
(my/prot-color color (modus-themes-get-theme-palette)))
(my/prot-color color (modus-themes-get-theme-palette (my/ef-p))))
#+end_src
Test the three functions.