Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get emacs background color

Specifically I am trying to make below codes work: the problem is that term-default-bg-color (close to the end of code block) doesn't seem to exist universally so I am trying to get emacs background color and use that

(defun low-lock-face-phrase-buffer (regexp )
  "Set face of each match of phrase REGEXP to term-default-bg-color to dim it;
  internally it calls to hi-lock-face-phrase-buffer" 
  (interactive
   (list
    (hi-lock-regexp-okay
     (hi-lock-process-phrase
      (read-regexp "Phrase to dim" (car regexp-history))))))
  (unless hi-lock-mode (hi-lock-mode 1))
  (hi-lock-set-pattern regexp 'term-default-bg-color))
like image 433
user2816669 Avatar asked Oct 05 '13 18:10

user2816669


1 Answers

In general, the background color is just (face-attribute 'default :background).

But if you want the background color at a particular position, where there might be one or more faces displayed, then use function eyedrop-background-at-point, from library eyedropper.el.

like image 136
Drew Avatar answered Sep 28 '22 01:09

Drew