Archive for November, 2008

Nov 30 2008 at 11:24am

How to search & replace colours in a vector graphic

Today I wanted to find and replace colours in a vector graphic. The greens weren’t quite what I wanted, but the image was full of gradients that I didn’t want to have to change by hand. Can any vector program search and replace colours? I wasn’t sure, but instead of searching around for one my husband helped me come up with this SVG solution:

Replace colours in a vector graphic

  1. Save your graphic as an SVG. You can use Inkscape, Illustrator, or pretty much any other vector program to do this.
  2. Make note of your “before” and “after” colours as hex values.
  3. Open the .svg file in a text editor. You’ll see some mark-up that looks much like HTML (that’s because SVG an XML specification).
  4. Search for your “before” values and replace with the “after”.
  5. Save.

That’s it! Now, if only Internet Explorer would support SVG so I didn’t have to export these as png’s…