diff options
| author | KΓ©vin Le Gouguec <kevin.legouguec@gmail.com> | 2023-01-03 01:27:20 +0100 |
|---|---|---|
| committer | KΓ©vin Le Gouguec <kevin.legouguec@gmail.com> | 2023-01-03 08:37:47 +0100 |
| commit | d5441b0b8a4b0da8436770131e4ae55aade6228f (patch) | |
| tree | d4b8c25925f1767cbe7fcbff4cf4fef64bd951b6 | |
| parent | 0e23bee07b2e5b3f69fce8d6465d7179aada68d7 (diff) | |
| download | dotfiles-d5441b0b8a4b0da8436770131e4ae55aade6228f.tar.xz | |
Thoroughly adapt to Modus v4
π΅βπ«
Trying to get back the sense of sharp contrast I had before.
Snippets from *scratch* in case I need to recompute some of these:
(defun my/color-hsl-to-rgbhex (h s l)
(apply
'color-rgb-to-hex
`(,@(color-hsl-to-rgb h s l) 2)))
(defun my/color-hs1-l2 (c1 c2)
(pcase-let ((`(,h1 ,s1 _) (apply 'color-rgb-to-hsl
(color-name-to-rgb c1)))
(`(_ _ ,l2) (apply 'color-rgb-to-hsl
(color-name-to-rgb c2))))
(message "hue %.3f with s %.3f l %.3f" h1 s1 l2)
(apply 'color-rgb-to-hex
`(,@(color-hsl-to-rgb h1 s1 l2) 2))))
(defun my/modus-rgb (key palette)
(let ((value (car (alist-get key palette))))
(if (stringp value)
value
(car (alist-get value palette)))))
(list-colors-display
(list (my/modus-rgb 'bg-completion modus-vivendi-palette)
(my/color-hs1-l2 (my/modus-rgb 'bg-completion modus-vivendi-palette)
"#303030")
(my/color-hs1-l2 (my/modus-rgb 'bg-completion modus-vivendi-palette)
"#202020")))
(pcase-dolist (`(,sym ,val)
modus-vivendi-palette)
(when-let ((color (and (string-match "bg-\\(.*\\)-subtle" (symbol-name sym))
(match-string 1 (symbol-name sym))))
(darker (color-darken-name val 40.0)))
(message "%s (%s): %.2f"
color
val
(modus-themes-contrast val (car (alist-get (intern color) modus-vivendi-palette))))
(message "%s (%s): %.2f"
color
darker
(modus-themes-contrast darker
(car (alist-get (intern color) modus-vivendi-palette))))))
(dolist (diffkind '(removed changed))
(dolist (suffix '("" "-faint" "-refine"))
(insert (format "(bg-%s%s \"%s\")\n"
))))
(list-colors-display
(seq-map (pcase-lambda (`(,h ,l))
(apply 'color-rgb-to-hex `(,@(color-hsl-to-rgb h 1.0 l) 2)))
'((0.00 0.04)
(0.00 0.08)
(0.00 0.16)
(0.59 0.04)
(0.59 0.08)
(0.59 0.16)
(0.12 0.04)
(0.12 0.08)
(0.12 0.16))))
| -rw-r--r-- | .emacs | 87 |
1 files changed, 65 insertions, 22 deletions
@@ -657,17 +657,35 @@ modus-themes-variable-pitch-ui t) (load-theme 'modus-vivendi)) -(defun my/hsl-to-rgbhex (h s l) +(defun my/color-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/color-hs1-l2 (c1 c2) + (pcase-let ((`(,h1 ,s1 _) (apply 'color-rgb-to-hsl + (color-name-to-rgb c1))) + (`(_ _ ,l2) (apply 'color-rgb-to-hsl + (color-name-to-rgb c2)))) + (message "hue %.3f with s %.3f l %.3f" h1 s1 l2) + (apply 'color-rgb-to-hex + `(,@(color-hsl-to-rgb h1 s1 l2) 2)))) + +(defun my/modus-rgb (key palette) + (let ((value (car (alist-get key palette)))) + (if (stringp value) + value + (car (alist-get value palette))))) + +(defun my/modus>=4-tune-faces () + (with-eval-after-load 'gnus + (set-face-foreground 'gnus-summary-normal-ancient "#989898")) ; β‘ -read + (with-eval-after-load 'magit + (set-face-foreground 'magit-blame-highlight "#989898") ; β‘ shadow + (set-face-background 'magit-blame-highlight "#1e1e1e"))) ; β‘ bg-dim (defun my/modus>=4-config () + (require-theme 'modus-themes) (setq modus-themes-bold-constructs t modus-themes-italic-constructs t modus-themes-mixed-fonts t @@ -678,23 +696,48 @@ (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)) + (setq modus-vivendi-palette-overrides + ;; THE LIGHT!!! IT BURNS USSSS!!! π§ + '((bg-dim "#0f0f0f") ; magit-diff-context-highlight, org-block + (bg-active "#303030") + (bg-inactive "#1e1e1e") + (bg-mode-line-active "#303030") + (bg-mode-line-inactive "#1e1e1e") + (bg-region "#242424") + ;; Original hues & saturations, much lower light. + (bg-hl-line "#191d26") + (bg-completion "#192546") + (bg-hover "#002f43") + ;; Darkened by 50%. + (bg-red-subtle "#3b0919") + (bg-green-subtle "#002719") + (bg-yellow-subtle "#2c2600") ; eldoc-highlight-function-argument + (bg-blue-subtle "#151648") + (bg-magenta-subtle "#331c39") + (bg-cyan-subtle "#00263c") + ;; Old deuteranopia diff colors (more or less) + darker backgrounds. + (bg-removed-faint "#140000") ; (my/color-hsl-to-rgbhex 0.00 1.0 0.04) + (bg-removed "#280000") ; (my/color-hsl-to-rgbhex 0.00 1.0 0.08) + (bg-removed-refine "#510000") ; (my/color-hsl-to-rgbhex 0.00 1.0 0.16) + (bg-removed-intense "#a30000") ; (my/color-hsl-to-rgbhex 0.00 1.0 0.32) + (fg-removed "#fecccc") ; (my/color-hsl-to-rgbhex 0.00 1.0 0.90) + (fg-removed-intense "#ff3232") ; (my/color-hsl-to-rgbhex 0.00 1.0 0.60) + (bg-added-faint "#000914") ; (my/color-hsl-to-rgbhex 0.59 1.0 0.04) + (bg-added "#001228") ; (my/color-hsl-to-rgbhex 0.59 1.0 0.08) + (bg-added-refine "#002551") ; (my/color-hsl-to-rgbhex 0.59 1.0 0.16) + (bg-added-intense "#004ba3") ; (my/color-hsl-to-rgbhex 0.59 1.0 0.32) + (fg-added "#cce3fe") ; (my/color-hsl-to-rgbhex 0.59 1.0 0.90) + (fg-added-intense "#3290ff") ; (my/color-hsl-to-rgbhex 0.59 1.0 0.60) + (bg-changed-faint "#0b0014") ; (my/color-hsl-to-rgbhex 0.12 1.0 0.04) + (bg-changed "#160028") ; (my/color-hsl-to-rgbhex 0.12 1.0 0.08) + (bg-changed-refine "#2d0051") ; (my/color-hsl-to-rgbhex 0.12 1.0 0.16) + (bg-changed-intense "#513a00") ; (my/color-hsl-to-rgbhex 0.12 1.0 0.16) + (fg-changed "#fef0cc") ; (my/color-hsl-to-rgbhex 0.12 1.0 0.90) + (fg-changed-intense "#ffc532") ; (my/color-hsl-to-rgbhex 0.12 1.0 0.60) + ;; Tweaks unrelated to dimming backgrounds: + (fg-region unspecified))) + (load-theme 'modus-vivendi) + (my/modus>=4-tune-faces)) (use-package emacs :when (>= emacs-major-version 28) |
