emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/rcirc-color 4f02e2b: Fix error triggered by default fac


From: Tassilo Horn
Subject: [elpa] externals/rcirc-color 4f02e2b: Fix error triggered by default face background being "unspecified-bg"
Date: Wed, 10 Feb 2021 10:08:13 -0500 (EST)

branch: externals/rcirc-color
commit 4f02e2bc42e4b31fce5d7a17845f1157f234b375
Author: Tassilo Horn <tsdh@gnu.org>
Commit: Tassilo Horn <tsdh@gnu.org>

    Fix error triggered by default face background being "unspecified-bg"
    
    * rcirc-color.el (rcirc-colors): If the default face's background is
    unspecified-bg, assume black or white depending on if the foreground color 
is
    dark.
---
 rcirc-color.el | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/rcirc-color.el b/rcirc-color.el
index d00a279..754750f 100644
--- a/rcirc-color.el
+++ b/rcirc-color.el
@@ -63,6 +63,11 @@ everything by 256. This also helps preventing integer 
overflow."
        (bg (face-background 'default))
        (fg (face-foreground 'rcirc-my-nick))
        candidates)
+    ;; Some themes don't specify a background for terminal displays (so that
+    ;; the terminal's transparency is still effective).  In that case, assume
+    ;; white or black depending on the foreground.
+    (when (string= bg "unspecified-bg")
+      (setq bg (if (color-dark-p (color-name-to-rgb fg)) "white" "black")))
     (dolist (item color-name-rgb-alist)
       (let ((color (car item)))
        (when (and (not (color-gray-p color))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]