color_replace.py revision 72728176afefe733049f0b73dc7ad65885a5f61b
import coloreffect
import inkex
class C(coloreffect.ColorEffect):
self.OptionParser.add_option("-f", "--from_color", action="store", type="string", dest="from_color", default="000000", help="Replace color")
self.OptionParser.add_option("-t", "--to_color", action="store", type="string", dest="to_color", default="000000", help="By color")
this_color = '%02x%02x%02x' % (r, g, b)
#inkex.debug(this_color+"|"+fr+"|"+to)
if this_color == fr:
return to
else:
return this_color
c = C()
c.affect()