From: goncholden <goncholden@protonmail.com>
To: goncholden <goncholden@protonmail.com>
Cc: Manuel Giraud <manuel@ledu-giraud.fr>,
goncholden via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org>
Subject: Setting colour for comments for light and dark theme
Date: Tue, 01 Feb 2022 12:35:13 +0000 [thread overview]
Message-ID: <UW38RCvOjfja1tJxYGHWsDNy2GU39bFEI4cE1bOoehJqnmHHg_ViLGBo8Cyguz5g1ki34ZdMEe5hAJePBMTOyVtPxSLCGJqU67NIGxKs0N0=@protonmail.com> (raw)
In-Reply-To: <a4M-a3fRu99wkqWzRSO_Bh6JnpKvn2Czssu3Lp4hg0svqHY41FgizRCX59edl66zj7FsmGUoFyGerujkAJP4J9FcVxUnE11RL3D1ntJRu6g=@protonmail.com>
Sent with ProtonMail Secure Email.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Tuesday, February 1st, 2022 at 11:28 AM, goncholden <goncholden@protonmail.com> wrote:
> On Tuesday, February 1st, 2022 at 10:34 AM, Manuel Giraud manuel@ledu-giraud.fr wrote:
>
> > Hi,
> >
> > Maybe you need a default match. Watch out untested code ahead:
> >
> > --8<---------------cut here---------------start------------->8---
> >
> > (defvar annotation-chroma
> >
> > '((dark . ((low . "#8300E0") (mid . "#AA33FF") (high . "#C370FF")))
> >
> > (light . ((low . "#C16BFF") (mid . "#AA33FF") (high . "#8000DB")))
> >
> > (default . ((low . "red") (mid . "green") (high . "blue"))))
> >
> > "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))
> >
> > (_ (alist-get 'default colors)))))
> >
> > (face-remap-add-relative 'font-lock-comment-face
> >
> > `(:foreground ,(alist-get chroma levels)))))
> >
> > --8<---------------cut here---------------end--------------->8---
>
> I wonder if there is any way that colours change whether one is using a light or dark theme. Is the light and dark setting inherent to emacs, or inherent to the theme? For instance the default can still check if the theme uses a light or dark background. Better still, the annotation colours could be set up for light and dark background irrespective of the particular instance of modus-themes. Meaning that the colours are set for any theme one could be using.
Have tried using (frame--current-backround-mode nil) but this gives
Symbol's function definition is void: frame--current-backround-mode
I am using Emacs 27.1
> > --
> >
> > Manuel Giraud
next prev parent reply other threads:[~2022-02-01 12:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-01 9:38 Setting colour for comments for light and dark theme goncholden via Users list for the GNU Emacs text editor
2022-02-01 10:34 ` Manuel Giraud
2022-02-01 11:28 ` goncholden
2022-02-01 12:35 ` goncholden [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='UW38RCvOjfja1tJxYGHWsDNy2GU39bFEI4cE1bOoehJqnmHHg_ViLGBo8Cyguz5g1ki34ZdMEe5hAJePBMTOyVtPxSLCGJqU67NIGxKs0N0=@protonmail.com' \
--to=goncholden@protonmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=manuel@ledu-giraud.fr \
/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.
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).