This is documentation for a simple command which allows for modifying the fill of the arrowheads generated by mermaidjs class diagrams. This allows for quick generation of UML class diagrams programmatically using mermaid whilst allowing to adhere to different diagram styles.
- Generate a
.svg
from mermaid.js, there are a couple easy ways to do this- Mermaid Live Editor - Browser Based Editor Download as SVG
- VSCode Mermaid Editor - Extension for VSCode that allows for live editing and saving as svg
- Run one of the two
sed
commands below, replacingfile.svg
with your input file
sed -i -r 's/\.(extension|aggregation)\{fill:#([0-9A-Fa-f]+)/\.\1\{fill:#ECECFF/g' file.svg
sed -r 's/\.(extension|aggregation)\{fill:#([0-9A-Fa-f]+)/\.\1\{fill:#ECECFF/g' file.svg > output.svg
The color can be customised by replacing #ECECFF
in the regex with any hex color code.