README file from
GithubSVG Color Replacer Plugin
A plugin for Obsidian that automatically adapts SVG image and mathematical formula colors to match dark theme styling.
How it works
- When a note loads, the plugin finds all SVG elements
- For each SVG:
- Gets the current Obsidian background color
- Replaces white color with this background color (hides white parts)
- Replaces black color with white (makes black text visible)
- Marks processed elements to avoid re-processing on updates
What gets processed
fill,stroke,colorattributes- Inline styles (CSS inside
style="") - Text elements (
<text>,<tspan>) - SVGs in both regular form and encoded in data-URLs
Installation
- Copy the plugin folder to
.obsidian/plugins/ - In Obsidian, open Settings → Community plugins → Reload plugins
- Enable the "SVG Color Replacer" plugin