devctrl.utility.svg_recolor.replace_colors_in_svg#
- replace_colors_in_svg(infile: str, outfile: str, replacements: dict[str, str], replace_existing: bool = False) str[source]#
Replace the colors of
infileand save asoutfile.Non-existing directories in
outfileare created.- Parameters:
infile – Input file.
outfile – Output file.
replacements – Dictionary of replacements key -> value
replace_existing – Whether to overwrite
outfileif it already exists.
- Returns:
Output file content.