GNU bug report logs - #77841
Some svg image's black color is replaced by emacs's theme foreground color

Previous Next

Package: emacs;

Reported by: Billy Lei <LeiYiXia29 <at> outlook.com>

Date: Wed, 16 Apr 2025 12:16:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Ihor Radchenko <yantar92 <at> posteo.net>
To: Alan Third <alan <at> idiocy.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 77841 <at> debbugs.gnu.org, Billy Lei <LeiYiXia29 <at> outlook.com>
Subject: bug#77841: Some svg image's black color is replaced by emacs's theme foreground color
Date: Sat, 19 Apr 2025 08:57:55 +0000
[Message part 1 (text/plain, inline)]
Alan Third <alan <at> idiocy.org> 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?

[org-ltximg_404bde694c76aad6deecfc21e91c044a6afd7948.svg (image/svg+xml, attachment)]
[Message part 3 (text/plain, inline)]
-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

This bug report was last modified 8 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.