unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Coloured comment delimiter
@ 2022-02-22 13:59 goncholden via Users list for the GNU Emacs text editor
  0 siblings, 0 replies; only message in thread
From: goncholden via Users list for the GNU Emacs text editor @ 2022-02-22 13:59 UTC (permalink / raw)
  To: goncholden via Users list for the GNU Emacs text editor

I have the following elisp configuration for customising a typeface for comments.
Am setting set-face-attribute for font-lock-comment-delimiter-face, but perhaps I
do not have to set it everytime I set the colour. I always want the delimiter green.

(defvar richkov-annotation-contrast 2
"Sets the colour contrast (against background) for comments.")

(defvar richkov-annotation-chroma
'( (dark . ((low . "#8600E6") (mid . "#AA33FF") (high . "#C370FF")))
(light . ((low . "#C16BFF") (mid . "#AA33FF") (high . "#8000DB"))) )
"Colour contrast for comments, indigo on dark and light background.")

(defun richkov-annotation-typeface (chroma)
"Set the foreground colour for comments.
CHROMA Intensity Key used for setting colour of comments ."

(message "richkov-annotation-typeface ")
(let* ( (colors richkov-annotation-chroma)
(levels
(alist-get (frame-parameter nil 'background-mode) colors)) )

(face-remap-add-relative 'font-lock-comment-face
`(:foreground ,(alist-get chroma levels)))

;; delimiter-face inherits from font-lock-comment-face
(if (eq 'dark (frame-parameter nil 'background-mode))

(set-face-attribute 'font-lock-comment-delimiter-face nil
:foreground "#00FF00") ; for dark theme

(set-face-attribute 'font-lock-comment-delimiter-face nil
:foreground "#00FFFF") ) ; for light theme

) )

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-22 13:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-22 13:59 Coloured comment delimiter goncholden via Users list for the GNU Emacs text editor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).