[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [External] : Re: Foreground color opacity
From: |
Filippo Argiolas |
Subject: |
Re: [External] : Re: Foreground color opacity |
Date: |
Mon, 11 Sep 2023 18:08:51 +0200 |
On Mon, Sep 11, 2023 at 4:58 PM Drew Adams <drew.adams@oracle.com> wrote:
> FWIW, in my library `hl-spotlight.el' I shade/highlight the
> background over several lines around the cursor - which is
> somewhat similar to the feature Filippo described, at least
> wrt dimming/highlighting a zone of text.
>
> I use an overlay, similar to what Eli suggested. Because in
> my case the zone is just some contiguous lines I leverage
> `hl-line-mode', substituting a different face for the line
> background dimming/highlighting.
>
> https://www.emacswiki.org/emacs/HighlightCurrentLine#HlSpotlight
> ___
>
> `hl-spotlight.el' just uses a face for the overlay, leaving
> it up to a user to customize that as needed.
>
> Library `isearch-prop.el' provides similar dimming/lightening
> of a zone of text (not necessarily lines). But it lets you
> choose whether to use a particular background color or to dim
> or lighten the background by a given factor. In the latter
> case it uses `color-saturate-name' or `color-lighten-name'
> from standard library `color.el' to do the dimming/lightening.
>
> https://www.emacswiki.org/emacs/download/isearch-prop.el
> ___
Thank you, I will definitely better look into your code with more time later.
At some point I tried using `color-darken-name' but for some reason I
forgot I didn't like it and implemented my own color blending
function. Will look at it again!
Problem is shading the background is kind of easy, with prog modes you
can somewhat safely assume [1] it to be constant on the whole
fontified buffer.
Foreground instead differs for each symbol in a given region so you
need to go over them and apply a different shaded face for each one.
It would be great to offset this job to the backend and just set an
alpha/opacity/whatever attribute in an overlay and let the backend do
the shading.
Cheers,
Filippo
1. kind of expect here to be proved wrong with some funky theme
example that sets different backgrounds for each font lock face
- Foreground color opacity, Filippo Argiolas, 2023/09/11
- Re: Foreground color opacity, Eli Zaretskii, 2023/09/11
- Re: Foreground color opacity, Filippo Argiolas, 2023/09/11
- Re: Foreground color opacity, Filippo Argiolas, 2023/09/11
- Re: Foreground color opacity, Eli Zaretskii, 2023/09/11
- Re: Foreground color opacity, Filippo Argiolas, 2023/09/11
- Re: Foreground color opacity, Eli Zaretskii, 2023/09/11
- Re: Foreground color opacity, Filippo Argiolas, 2023/09/12
- Re: Foreground color opacity, Filippo Argiolas, 2023/09/12