]> git.eshelyaron.com Git - emacs.git/commitdiff
Use css to set SVG foreground in docview
authorAlan Third <alan@idiocy.org>
Sun, 4 May 2025 18:08:00 +0000 (19:08 +0100)
committerEshel Yaron <me@eshelyaron.com>
Thu, 24 Jul 2025 08:04:35 +0000 (10:04 +0200)
* lisp/doc-view.el (doc-view-insert-image): Use CSS to set the fill
attribute to the desired foreground color.

(cherry picked from commit 8b200c041924904074b996addaec0b4ccfb1a024)

lisp/doc-view.el

index 461e109ef74700e14d67fd3e3d62b4634b136583..ff0d8ee470318fc4c9e1e5d70658bb060762431c 100644 (file)
@@ -1674,7 +1674,8 @@ ARGS is a list of image descriptors."
                             (setq args `(,@args :transform-smoothing t)))
                           (when (eq doc-view--image-type 'svg)
                             (setq args `(,@args :background ,(face-background 'doc-view-svg-face)
-                                                :foreground ,(face-foreground 'doc-view-svg-face))))
+                                                :foreground ,(face-foreground 'doc-view-svg-face)
+                                                :css "svg{fill:currentcolor;}")))
                          (apply #'create-image file doc-view--image-type nil args))))
             (slice (doc-view-current-slice))
             (img-width (and image (car (image-size image))))