Subject: bug#77841: Some svg image's black color is replaced by emacs's theme foreground color

From: Alan Third <[email-masked]>
Date: Sat, 3 May 2025 16:31:39 +0100

On Sat, May 03, 2025 at 04:50:24PM +0200, Manuel Giraud wrote:
> Ihor Radchenko <[email-masked]> writes:
> 
> > Manuel Giraud <[email-masked]> writes:
> >
> >>> Could you tell me more about "widget look and feel"?
> >>> Is it about some very specific use case of svgs in Emacs?
> >>
> >> I was refering to the first comment Alan made in this thread.  The
> >> example that comes to my mind is the customize interface: some settings
> >> are toggle buttons that are rendered with SVG provided with Emacs and
> >> that will have the correct (i.e., same as default face) foreground and
> >> background values.
> >
> > I see. So, we are talking about svgs that are specifically designed with
> > current behavior in mind. May those svgs be marked to use foreground
> > color via image properties?
> 
> Maybe there are other use case for such SVG: I cannot pretend I was
> exhaustive.

I was thinking about this, but I couldn't remember where to find it.
Some searching helped:

    https://github.com/rougier/svg-lib

But on digging into it it looks as though he's setting the SVG's
colours explicitly, probably for backward compatibility, so hopefully
not an issue.

The widgets are designed to be used outside of customize, it's a
separate library. But we can still fix the widget library if
necessary.

> > Alternatively, the proposed variable can be set locally in customize
> > buffers.
> 
> If anything, I think I'd prefer this approach but maybe the other way
> around: which buffers will need to have a default back/foreground to
> black?

This is already how it works, the caller can set the foreground and
background to black and white if they want.

Does anyone know anything about "CurrentColor" in CSS? I'm wondering
if that's our solution...
-- 
Alan Third