Skip to content

Commit

Permalink
Add fallback policy to make sure acm-frame-color-blend won't failed.
Browse files Browse the repository at this point in the history
  • Loading branch information
manateelazycat committed Jul 27, 2024
1 parent 6a05af5 commit 92d58ff
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions acm/acm-frame.el
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,11 @@ influence of C1 on the result."
(face-attribute 'default :background)
(face-attribute 'acm-frame-default-face :background))))

;; Fallback to background of `default' face if `acm-frame-color-blend' test failed.
(unless (ignore-errors
(acm-frame-color-blend default-background blend-background 0.6))
(setq default-background (if is-dark-mode "#000000" "#AAAAAA")))

;; Make sure menu follow the theme of Emacs.
(when (or force (equal (face-attribute 'acm-frame-default-face :background) 'unspecified))
(set-face-background 'acm-frame-default-face (acm-frame-color-blend default-background blend-background (if is-dark-mode 0.8 0.9))))
Expand Down

0 comments on commit 92d58ff

Please sign in to comment.