eighters-theme

Eighters gonna eight.
git clone https://git.kevinlegouguec.net/eighters-theme
Log | Files | Refs | README | LICENSE

helpers.el (1372B)


      1 (defun my/color-mix (color-1 color-2 ratio)
      2   (let* ((c1 (color-name-to-rgb color-1))
      3          (c2 (color-name-to-rgb color-2))
      4          (mix (-zip-with
      5                (lambda (i1 i2) (+ (* ratio i1)
      6                                   (* (- 1 ratio) i2)))
      7                c1 c2)))
      8     (apply 'color-rgb-to-hex `(,@mix 2))))
      9 
     10 ;; Alternate implementation without -zip-with from dash.
     11 (defun my/color-mix (color-1 color-2 ratio)
     12   (let* ((c1 (color-name-to-rgb color-1))
     13          (c2 (color-name-to-rgb color-2))
     14          (mix (seq-map
     15                (lambda (pair) (+ (* ratio (car pair))
     16                                  (* (- 1 ratio) (cdr pair))))
     17                (cl-pairlis c1 c2))))
     18     (apply 'color-rgb-to-hex `(,@mix 2))))
     19 
     20 ;; Diff faces.
     21 
     22 (setq my/background "black")
     23 
     24 (list-colors-display
     25  (seq-map (lambda (r) (my/color-mix my/background "steelblue2" r))
     26           (number-sequence 0.0 1.0 0.01))
     27  "*steelblues*")
     28 
     29 (list-colors-display
     30  (seq-map (lambda (r) (my/color-mix my/background "orange2" r))
     31           (number-sequence 0.0 1.0 0.01))
     32  "*oranges*")
     33 
     34 (list-colors-display
     35  (seq-map (lambda (c) (my/color-mix my/background c 0.9))
     36           '("orange2" "steelblue2" "gold2" "maroon2"))
     37  "*regular-diff*")
     38 
     39 (list-colors-display
     40  (seq-map (lambda (c) (my/color-mix my/background c 0.7))
     41           '("orange2" "steelblue2" "gold2" "maroon2"))
     42  "*refined-diff*")