help-gnu-emacs
[Top][All Lists]
Advanced

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

Coloured comment delimiter


From: goncholden
Subject: Coloured comment delimiter
Date: Tue, 22 Feb 2022 13:59:22 +0000

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

) )

reply via email to

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