summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.emacs58
1 files changed, 54 insertions, 4 deletions
diff --git a/.emacs b/.emacs
index b810d3c..d9b99ab 100644
--- a/.emacs
+++ b/.emacs
@@ -640,9 +640,7 @@
:custom
(use-package-always-defer t))
-(use-package emacs
- :when (>= emacs-major-version 28)
- :init
+(defun my/modus<4-config ()
(setq modus-themes-bold-constructs t
modus-themes-deuteranopia t
modus-themes-diffs 'bg-only
@@ -657,9 +655,61 @@
modus-themes-prompts '(background)
modus-themes-region '(bg-only)
modus-themes-variable-pitch-ui t)
- :config
(load-theme 'modus-vivendi))
+(defun my/hsl-to-rgbhex (h s l)
+ (apply
+ 'color-rgb-to-hex
+ `(,@(color-hsl-to-rgb h s l) 2)))
+
+(defun my/decline-diff-hue (h)
+ (list-colors-display
+ (seq-map (lambda (l) (my/hsl-to-rgbhex h 1.0 l))
+ '(0.04 0.08 0.16))))
+
+(defun my/modus>=4-config ()
+ (setq modus-themes-bold-constructs t
+ modus-themes-italic-constructs t
+ modus-themes-mixed-fonts t
+ modus-themes-variable-pitch-ui t
+ modus-themes-headings '((1 . (variable-pitch 1.2))
+ (2 . (variable-pitch 1.15))
+ (3 . (variable-pitch 1.1))
+ (4 . (variable-pitch 1.05))
+ (t . (variable-pitch)))
+ modus-themes-org-blocks 'gray-background)
+ (load-theme 'modus-vivendi-deuteranopia)
+ (setq modus-vivendi-deuteranopia-palette-overrides
+ ;; TODO: set bg-prompt?
+ `(;; (my/decline-diff-hue 0.14)
+ (bg-removed-faint "#141100")
+ (bg-removed "#282200")
+ (bg-removed-refine "#514400")
+ ;; (my/decline-diff-hue 0.59)
+ (bg-added-faint "#000914")
+ (bg-added "#001228")
+ (bg-added-refine "#002551")
+ ;; (my/decline-diff-hue 0.76)
+ (bg-changed-faint "#0b0014")
+ (bg-changed "#160028")
+ (bg-changed-refine "#2d0051")
+ ,@modus-themes-preset-overrides-faint))
+ (load-theme 'modus-vivendi-deuteranopia))
+
+(use-package emacs
+ :when (>= emacs-major-version 28)
+ ;; `(modus-themes) Sample configuration with and without
+ ;; use-package' recommends setting options in :init and loading the
+ ;; theme in :config; unfortunately it's not possible to access the
+ ;; palettes without loading the themes AFAICT, so do everything in
+ ;; :config.
+ :config
+ (cond
+ ((memq 'modus-vivendi-deuteranopia (custom-available-themes))
+ (my/modus>=4-config))
+ (t
+ (my/modus<4-config))))
+
(use-package package
:custom
(package-selected-packages