Mobile app version of vmapp.org
Login or Join
Debbie163

: Mass change the colour of 300 .svg files I have 300 .svg files, all are black, simple vector graphics. Is there any chance to change color from black to white ? Of course mass. Thanks Ad

@Debbie163

Posted in: #Color #Svg

I have 300 .svg files, all are black, simple vector graphics. Is there any chance to change color from black to white ? Of course mass.

Thanks
Ad

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Debbie163

2 Comments

Sorted by latest first Latest Oldest Best

 

@Cofer715

You could use a "sed" script like this (change.sh):

for x in $*
do
sed -e "s/#ED1C24/#ccddee/g" $x > temp$x
mv temp$x $x
done


Run it with "change.sh *.svg"

As mentioned in @hsawire 's answer, this can't be "undone" either, so to be safe it's best to copy your original SVG files into another directory for safe-keeping before doing a batch edit on them.

Or use a similar script with your favorite text editor, so long as your editor can be "batched" or "scripted", e.g. hsawires' demo with Dreamweaver.

Be sure your colors in the source SVG are actually expressed in HEX. Sometimes they are represented in other ways; for example the ImageMagick
command

convert -size 8x8 -xc:black -bordercolor #888 -frame 8x8 file.svg


produces a 24x24 SVG file with the pixels expressed as an embedded PNG, and a simple text editor won't work on such SVG files.

10% popularity Vote Up Vote Down


 

@Gloria351

Yes sure,

First you have to Define a site in Dreamweaver and make sure to associate .SVG with Dreamweaver.

Use Find and Replace or click Ctrl / cmd + F select from "Find in" list Entire Current Local Site and from search list Source codeand in the Find text box type the color that you want to replace and in the Replace text box type the new color that you want. and click Replace All



please note that this action could not undo

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme