SVG Color Replacer
pendingby Mahiron47
Replaces black color with white in SVG rendered from LaTeX for dark mode compatibility.
SVG 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
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.