From: Eli Zaretskii <eliz@gnu.org>
To: Filippo Argiolas <filippo.argiolas@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Foreground color opacity
Date: Mon, 11 Sep 2023 15:58:45 +0300 [thread overview]
Message-ID: <83fs3krhmi.fsf@gnu.org> (raw)
In-Reply-To: <CAOdrLGL0JWxANi=7tY1D+dAYT8t5EcSZmbM4KYw0uXJKYSWGUQ@mail.gmail.com> (message from Filippo Argiolas on Mon, 11 Sep 2023 12:45:04 +0200)
> From: Filippo Argiolas <filippo.argiolas@gmail.com>
> Date: Mon, 11 Sep 2023 12:45:04 +0200
>
> My approach so far has been something like this:
> - label inactive regions with a dedicated text property
> - add a function that runs after fontify-lock-fontify-region-function
> (after so we run when we have fortified text with font lock faces)
> - inside the fontify function detect face changes in the inactive
> region and for each different face encountered apply a new one with
> foreground color computed blending current foreground and background
>
> It seems to work so far and I like the result, but I keep thinking
> it's overly complicated for something so simple as setting text
> opacity. I'm pretty new to emacs lisp, am I missing a face attribute I
> can just set in an overlay and get the same result? Wouldn't it make
> sense to have something like this at backend level if it doesn't exist
> yet?
Why not cover the "inactive" portion with an overlay which has the
'face' (or font-lock-face) property that specifies only the opacity?
That is IMO simpler and doesn't need to run any functions after
fontifications.
(Caveat: I didn't actually try this approach, so maybe I'm missing
something.)
Thanks.
next prev parent reply other threads:[~2023-09-11 12:58 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-11 10:45 Foreground color opacity Filippo Argiolas
2023-09-11 12:58 ` Eli Zaretskii [this message]
2023-09-11 13:09 ` Filippo Argiolas
2023-09-11 14:04 ` Eli Zaretskii
2023-09-11 14:58 ` [External] : " Drew Adams
2023-09-11 16:08 ` Filippo Argiolas
2023-09-11 16:25 ` Filippo Argiolas
2023-09-11 16:56 ` Eli Zaretskii
2023-09-11 19:00 ` Filippo Argiolas
2023-09-12 2:21 ` Eli Zaretskii
2023-09-12 4:55 ` Filippo Argiolas
2023-09-12 5:24 ` Filippo Argiolas
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=83fs3krhmi.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=filippo.argiolas@gmail.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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).