# SVG-Image Color remapping

**URL:** <https://forum.obsidian.md/t/svg-image-color-remapping/80832>\
**Category:** Devs: Theme Design & Custom CSS\
**Created:** [April 24, 2024, 8:11pm UTC](https://forum.obsidian.md/t/svg-image-color-remapping/80832 "2024-04-24T20:11:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pummelfisch](https://forum.obsidian.md/user_avatar/forum.obsidian.md/pummelfisch/32/3559_2.png) [@Pummelfisch](https://forum.obsidian.md/u/Pummelfisch)\
**Post date:** [April 24, 2024, 8:11pm UTC](https://forum.obsidian.md/t/svg-image-color-remapping/80832/1 "2024-04-24T20:11:28Z")

</div>

# Problem

I use multiple colors in my vault. For consistency i like to use the same colors in the images I create and then embed. The problem is, when I switch to dark mode, I use slightly different colors. These are not just inverted or shifted, but actually selected different colors. For headers and other ui elements it is no problem to set different colors for the elements, using the minimal theme.  
However the images look of, since they dont change colors, when I change to dark mode.

## Proposed Idea

Since all my images are svg-files I wonder if it is possible to target a specific color inside of svg-files and change the rendered color with a css-snippet.  
So lets say I have a svg-file with two object, one in blue and one in red. Could I target just the red object and change it to orange with css?

I am a complete nooby with css, so I dont even know where to start.  
All I found was [this](https://forum.obsidian.md/t/auto-adaptive-images-for-dark-light-theme/13494). However here all colors of an svg are directly inverted and shifte and not selected individually.

---

<div class="post-metadata">

**Author:** ![yen\_le](https://forum.obsidian.md/user_avatar/forum.obsidian.md/yen_le/32/61132_2.png) [@yen\_le](https://forum.obsidian.md/u/yen_le)\
**Post date:** [May 22, 2024, 4:47pm UTC](https://forum.obsidian.md/t/svg-image-color-remapping/80832/2 "2024-05-22T16:47:51Z")

</div>

I don’t think this is feasible. I’ve tried to embed an svg but it is displayed like a normal image, you cannot select individual elements.

---

<div class="post-metadata">

**Author:** ![Pummelfisch](https://forum.obsidian.md/user_avatar/forum.obsidian.md/pummelfisch/32/3559_2.png) [@Pummelfisch](https://forum.obsidian.md/u/Pummelfisch)\
**Post date:** [May 24, 2024, 12:37pm UTC](https://forum.obsidian.md/t/svg-image-color-remapping/80832/3 "2024-05-24T12:37:36Z")

</div>

Ah so svg-images are not realy inserted as svg-files but are converted to some other file format?

---

<div class="post-metadata">

**Author:** ![yen\_le](https://forum.obsidian.md/user_avatar/forum.obsidian.md/yen_le/32/61132_2.png) [@yen\_le](https://forum.obsidian.md/u/yen_le)\
**Post date:** [May 24, 2024, 4:04pm UTC](https://forum.obsidian.md/t/svg-image-color-remapping/80832/4 "2024-05-24T16:04:39Z")

</div>

Yeah, when I try to embed a local file, or an external link, it is displayed using `img` tag not `svg` tag like some of the UI buttons that allow stroke to be of different colors.

 ![image](https://forum.obsidian.md/uploads/default/original/3X/4/2/426a91a121427d1f3ebce44c59654b0d2374935a.jpeg)

---

<div class="post-metadata">

**Author:** ![denroj](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/d/d6d6ee/32.png) [@denroj](https://forum.obsidian.md/u/denroj)\
**Post date:** [August 6, 2025, 2:32am UTC](https://forum.obsidian.md/t/svg-image-color-remapping/80832/5 "2025-08-06T02:32:16Z")

</div>

@Pummelfisch @yen_le  
Hi guys, were you able to find a solution?"

---

<div class="post-metadata">

**Author:** ![Pummelfisch](https://forum.obsidian.md/user_avatar/forum.obsidian.md/pummelfisch/32/3559_2.png) [@Pummelfisch](https://forum.obsidian.md/u/Pummelfisch)\
**Post date:** [August 8, 2025, 10:00am UTC](https://forum.obsidian.md/t/svg-image-color-remapping/80832/6 "2025-08-08T10:00:19Z")

</div>

Unfortunately not, I have settled with the idea that this is not solvable with css alone. If I understood @yen_le correctly we would need to either change the display method of svg files in notes or intercept the conversion process of the svg files to normal images. I lack the skills to even know if this is feasible or not.
