emacs-devel
[Top][All Lists]
Advanced

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

Re: Foreground color opacity


From: Eli Zaretskii
Subject: Re: Foreground color opacity
Date: Mon, 11 Sep 2023 15:58:45 +0300

> 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.



reply via email to

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