~pkal/face-shift

a2e9d005683e0cd979731d56791f6aa547aa0a08 — Philip Kaludercic 3 years ago 0170ab2
Add face-shift-shift-foreground option
1 files changed, 7 insertions(+), 1 deletions(-)

M face-shift.el
M face-shift.el => face-shift.el +7 -1
@@ 81,6 81,10 @@ See info node `(emacs) Colors' or `color-name-to-rgb' for more
information."
  :type '(alist :key-type face :value-type string))

(defcustom face-shift-shift-foreground nil
  "Non-nil means shift the forground color too."
  :type 'boolean)

(defvar-local face-shift--cookies nil
  "List of remapped faces in a single buffer.")



@@ 113,7 117,9 @@ If BUFFER is nil, use current buffer."
           (col-rgb (and colour (color-name-to-rgb colour))))
      (when colour
        (dolist (face face-shift-faces)
          (dolist (prop '(:foreground :background))
          (dolist (prop (if face-shift-shift-foreground
                            '(:background :foreground)
                          '(:background)))
            (let* ((attr (face-attribute face prop))
                   (rgb (and attr (color-name-to-rgb attr)))
                   (shift (and rgb (face-shift--interpolate col-rgb rgb)))