From 872f24cb26e645acb997089fa7aad709146e407f Mon Sep 17 00:00:00 2001 From: Lars Tveito Date: Sun, 8 Mar 2020 20:37:31 +0100 Subject: [PATCH] Simplify making a unfocused face --- focus.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/focus.el b/focus.el index 1d06cf7..ffba859 100644 --- a/focus.el +++ b/focus.el @@ -142,13 +142,13 @@ The timer calls `focus-read-only-hide-cursor' after (defun focus-make-unfocused-face (fg) "Add dimmed foreground color FG to the `focus-unfocused` face." (let ((bg (face-background 'default))) - (when (and fg bg (color-defined-p fg) (color-defined-p bg)) - (if (color-defined-p (face-attribute 'focus-unfocused :foreground)) - 'focus-unfocused + (if (and fg bg (color-defined-p fg) (color-defined-p bg) + (not (color-defined-p (face-attribute 'focus-unfocused :foreground)))) (plist-put (face-attr-construct 'focus-unfocused) :foreground (focus-lerp (color-name-to-rgb fg) (color-name-to-rgb bg) - focus-fraction)))))) + focus-fraction)) + 'focus-unfocused))) (defun focus-foreground-from-face (face) "Return foreground color for FACE, or 'default if nil."