summaryrefslogtreecommitdiff
path: root/.emacs.d
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@gmail.com>2023-02-01 08:11:26 +0100
committerKévin Le Gouguec <kevin.legouguec@gmail.com>2023-02-12 10:26:12 +0100
commit25f04e5bff8b3f5d28df0baf647b554657f50b0a (patch)
tree755b823cb898ae89b87efb9a291d4e8f90ef1466 /.emacs.d
parent539e025464d98e166ae71ed909e065e470ac562c (diff)
downloaddotfiles-25f04e5bff8b3f5d28df0baf647b554657f50b0a.tar.xz
Make palette showcase more informative
Diffstat (limited to '.emacs.d')
-rw-r--r--.emacs.d/eighters-theme.el21
1 files changed, 18 insertions, 3 deletions
diff --git a/.emacs.d/eighters-theme.el b/.emacs.d/eighters-theme.el
index 3f27325..8f070ae 100644
--- 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)