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

From: Alan Third <[email-masked]>
Date: Sat, 19 Apr 2025 11:01:12 +0100

On Sat, Apr 19, 2025 at 08:57:55AM +0000, Ihor Radchenko wrote:
> Alan Third <[email-masked]> writes:
> 
> >> Yes, this is a feature.  I think to disable it, you need to include a
> >> :background setting in the image spec.  Alan, am I right?
> >
> > Yes, but in this particular case :foreground, probably.
> >
> > This behaviour is documented in the elisp manual under "SVG Images"
> > and is intended to make it easier to insert images into buffers so
> > they look like native widgets and the like.
> 
> I am still confused.
> Consider the attached svg image.
> 
> If I emacs -Q org-ltximg_404bde694c76aad6deecfc21e91c044a6afd7948.svg
> I see black background and white foreground.
> 
> If I
> 1. emacs -Q
> 2. (put-text-property 1 2 'display (create-image "/tmp/ltximg/org-ltximg_404bde694c76aad6deecfc21e91c044a6afd7948.svg"))
> I see red-ish background and white foreground.
> 
> Seemingly, background and foreground are inverted in the second case.
> 
> What am I missing?

The image draws a rectangle in the current foreground colour, black in
the first case and red in the second, and then fills the text with
"#fff".

    <g fill='#fff'>

-- 
Alan Third