all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: goncholden via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
To: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Setting colour for comments for light and dark theme
Date: Tue, 01 Feb 2022 09:38:40 +0000	[thread overview]
Message-ID: <OGatlG4K3DTgjbhQ5NxdsGnNMT53bCq8CZMX9DKx1J2gjs4GQmdvgHjBr9EOQow3fqqzYasdyGSaJBlviDyDVxs-AuXWrMDMF387Jt1Qvuw=@protonmail.com> (raw)

Have been using the following code to change the colour of comments according
to whether I have a dark or light background. I am using modus-themes. But these
few days I needed to disable modus-themes when debugging and the code breaks
because there are no instructions for when modus-themes is disabled.

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

(defun annotation-typeface (chroma)
"Set the foreground colour for comments.
CHROMA Intensity Key used for setting colour of comments ."
(let* ( (colors annotation-chroma)
(levels
(pcase (car custom-enabled-themes)
('modus-operandi (alist-get 'light colors))
('modus-vivendi (alist-get 'dark colors)))) )

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

             reply	other threads:[~2022-02-01  9:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-01  9:38 goncholden via Users list for the GNU Emacs text editor [this message]
2022-02-01 10:34 ` Setting colour for comments for light and dark theme Manuel Giraud
2022-02-01 11:28   ` goncholden
2022-02-01 12:35     ` goncholden
2022-02-03  2:13     ` Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='OGatlG4K3DTgjbhQ5NxdsGnNMT53bCq8CZMX9DKx1J2gjs4GQmdvgHjBr9EOQow3fqqzYasdyGSaJBlviDyDVxs-AuXWrMDMF387Jt1Qvuw=@protonmail.com' \
    --to=help-gnu-emacs@gnu.org \
    --cc=goncholden@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.