diff options
| author | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2019-05-28 10:13:43 +0200 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2019-05-28 10:13:43 +0200 |
| commit | 4def9b711509c48665d7390cccfd324423b4b3ec (patch) | |
| tree | c7ed477250a42b2dc0d781c5b88f47890d6fe6f8 | |
| parent | 750899cdcd305ef33da2d5838eedb972c077be4d (diff) | |
| download | eighters-theme-4def9b711509c48665d7390cccfd324423b4b3ec.tar.xz | |
Tweak diff faces again
Now with an actual formula to compute blends 🙌
Will probably tweak refined faces again to tone the color down.
| -rw-r--r-- | eighters-theme.el | 18 | ||||
| -rw-r--r-- | helpers.el | 41 |
2 files changed, 50 insertions, 9 deletions
diff --git a/eighters-theme.el b/eighters-theme.el index e504e45..6c43dbb 100644 --- a/eighters-theme.el +++ b/eighters-theme.el @@ -43,15 +43,15 @@ '(mode-line-inactive ((t (:foreground "gray70" :background "gray25" :inherit (mode-line))))) '(mode-line-buffer-id ((t (:weight bold)))) ;; Main diff faces, and derivatives. - '(diff-added ((t (:background "#07243F")))) - '(diff-removed ((t (:background "#3f2900")))) - '(diff-changed ((t (:background "#2a2a08")))) - '(diff-refine-added ((t (:background "#0f487f")))) - '(diff-refine-removed ((t (:background "#7f5200")))) - '(diff-refine-changed ((t (:background "yellow4")))) + '(diff-added ((t (:background "#373f45")))) + '(diff-removed ((t (:background "#453d2d")))) + '(diff-changed ((t (:background "#45412d")))) + '(diff-refine-added ((t (:background "#43637d")))) + '(diff-refine-removed ((t (:background "#7d5c1e")))) + '(diff-refine-changed ((t (:background "#7d6f1e")))) '(diff-indicator-added ((t (:foreground "steelblue2")))) '(diff-indicator-removed ((t (:foreground "orange2")))) - '(diff-indicator-changed ((t (:foreground "yellow2")))) + '(diff-indicator-changed ((t (:foreground "gold2")))) '(ediff-current-diff-A ((t (:inherit (diff-removed))))) '(ediff-current-diff-B ((t (:inherit (diff-added))))) '(ediff-current-diff-C ((t ((:inherit (diff-changed)))))) @@ -66,8 +66,8 @@ ;; Supplementary diff faces. '(diff-header ((t (:foreground "steelblue1" :weight bold)))) '(diff-file-header ((t (:foreground "cyan" :weight bold)))) - '(ediff-current-diff-Ancestor ((t (:background "#340824")))) - '(ediff-fine-diff-Ancestor ((t (:background "#681048")))) + '(ediff-current-diff-Ancestor ((t (:background "#45323e")))) + '(ediff-fine-diff-Ancestor ((t (:background "#7d3161")))) '(ediff-even-diff-A ((t (:background "gray25")))) '(ediff-odd-diff-A ((t (:background "gray25")))) '(ediff-even-diff-B ((t (:background "gray25")))) diff --git a/helpers.el b/helpers.el new file mode 100644 index 0000000..4cd07c7 --- /dev/null +++ b/helpers.el @@ -0,0 +1,41 @@ +(defun my/color-mix (color-1 color-2 ratio) + (let* ((c1 (color-name-to-rgb color-1)) + (c2 (color-name-to-rgb color-2)) + (mix (-zip-with + (lambda (i1 i2) (+ (* ratio i1) + (* (- 1 ratio) i2))) + c1 c2))) + (apply 'color-rgb-to-hex `(,@mix 2)))) + +;; Alternate implementation without -zip-with from dash. +(defun my/color-mix (color-1 color-2 ratio) + (let* ((c1 (color-name-to-rgb color-1)) + (c2 (color-name-to-rgb color-2)) + (mix (seq-map + (lambda (pair) (+ (* ratio (car pair)) + (* (- 1 ratio) (cdr pair)))) + (cl-pairlis c1 c2)))) + (apply 'color-rgb-to-hex `(,@mix 2)))) + +;; Diff faces. + +(list-colors-display + (seq-map (lambda (r) (my/color-mix "gray20" "steelblue2" r)) + (number-sequence 0.0 1.0 0.01)) + "*steelblues*") + +(list-colors-display + (seq-map (lambda (r) (my/color-mix "gray20" "orange2" r)) + (number-sequence 0.0 1.0 0.01)) + "*oranges*") + +;; background: +(my/color-mix "gray20" "orange2" 0.9) +(my/color-mix "gray20" "steelblue2" 0.9) +(my/color-mix "gray20" "gold2" 0.9) +(my/color-mix "gray20" "maroon2" 0.9) +;; refined: +(my/color-mix "gray20" "orange2" 0.6) +(my/color-mix "gray20" "steelblue2" 0.6) +(my/color-mix "gray20" "gold2" 0.6) +(my/color-mix "gray20" "maroon2" 0.6) |
