dotfiles

🎜 Clone'em, tweak'em, stick'em in your $HOME 🎝
git clone https://git.kevinlegouguec.net/dotfiles
Log | Files | Refs | README

commit 25f04e5bff8b3f5d28df0baf647b554657f50b0a
parent 539e025464d98e166ae71ed909e065e470ac562c
Author: KΓ©vin Le Gouguec <kevin.legouguec@gmail.com>
Date:   Wed,  1 Feb 2023 08:11:26 +0100

Make palette showcase more informative

Diffstat:
M.emacs.d/eighters-theme.el | 21++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/.emacs.d/eighters-theme.el b/.emacs.d/eighters-theme.el @@ -66,9 +66,24 @@ (defun eighters-show-palette () (interactive) - (list-colors-display - (mapcar 'cadr eighters-palette) - "*Eighters palette*")) + (let ((buf (get-buffer-create "*Eighters palette*"))) + (with-current-buffer buf + (pcase-dolist (`(,sym ,color) + eighters-palette) + (pcase-let* ((`(,r ,g ,b) (color-name-to-rgb color)) + (`(,h ,s ,l) (color-rgb-to-hsl r g b))) + (let (bg fg face) + (if (string-prefix-p "fg" (symbol-name sym)) + (setq fg color + bg "#000") + (setq bg color + fg "#fff")) + (setq face `(:foreground ,fg :background ,bg :extend t)) + (insert + (propertize (format "%-16s\t(%.3f %.3f %.3f) (%.3f %.3f %.3f)\t\t%.3f\n" + sym r g b h s l (modus-themes-contrast fg bg)) + 'face face))))) + (pop-to-buffer buf)))) (defun eighters-dump-palette () (interactive)