Ayush, please run pylint and pep8 over your code and attach to the ticket.<br>Thanks.<br><br>Gonzalo<br><br><br><div class="gmail_quote">On Sat, Oct 16, 2010 at 7:10 PM, Ayush Goyal <span dir="ltr"><<a href="mailto:ayush@seeta.in">ayush@seeta.in</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><br>
Signed-off-by: Ayush Goyal <<a href="mailto:ayush@seeta.in">ayush@seeta.in</a>><br>
---<br>
 Area.py                 |   40 +++++<br>
 icons/invert-colors.svg |  387 +++++++++++++++++++++++++++++++++++++++++++++++<br>
 toolbox.py              |   22 ++-<br>
 3 files changed, 441 insertions(+), 8 deletions(-)<br>
 create mode 100644 icons/invert-colors.svg<br>
<br>
diff --git a/Area.py b/Area.py<br>
index 2dca7da..7c7f4c5 100644<br>
--- a/Area.py<br>
+++ b/Area.py<br>
@@ -70,6 +70,7 @@ import pango<br>
 from fill import *<br>
 from Desenho import Desenho<br>
 from urlparse import urlparse<br>
+import numpy<br>
<br>
 ##Tools and events manipulation are handle with this class.<br>
<br>
@@ -833,6 +834,45 @@ class Area(gtk.DrawingArea):<br>
         self.queue_draw()<br>
         if not self.selmove:<br>
             self.enableUndo(widget)<br>
+<br>
+    def invert_colors(self,widget):<br>
+        """Apply invert color effect.<br>
+<br>
+            @param  self -- the Area object (GtkDrawingArea)<br>
+            @param  widget -- the Area object (GtkDrawingArea)<br>
+<br>
+        """<br>
+<br>
+        width, height = self.window.get_size()<br>
+<br>
+        if self.selmove:<br>
+            size = self.pixmap_sel.get_size()<br>
+            pix = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB,False,8,size[0],size[1])<br>
+            pix.get_from_drawable(self.pixmap_sel,gtk.gdk.colormap_get_system(),0,0,0,0,size[0],size[1])<br>
+        else:<br>
+            pix = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB,False,8,width,height)<br>
+            pix.get_from_drawable(self.pixmap,gtk.gdk.colormap_get_system(),0,0,0,0,width,height)<br>
+<br>
+        pix_manip2=pix.get_pixels_array()<br>
+        pix_manip=numpy.ones(pix_manip2.shape,dtype=numpy.uint8)*255<br>
+        pix_manip2=pix_manip-pix_manip2<br>
+        pix=gtk.gdk.pixbuf_new_from_array(pix_manip2,gtk.gdk.COLORSPACE_RGB,8)<br>
+<br>
+<br>
+        if self.selmove:<br>
+            self.pixmap_sel.draw_pixbuf(self.gc,pix,0,0,0,0,size[0],size[1],dither=gtk.gdk.RGB_DITHER_NORMAL,x_dither=0,y_dither=0)<br>
+<br>
+            self.pixmap_temp.draw_drawable(self.gc,self.pixmap,0,0,0,0,width,height)<br>
+            self.pixmap_temp.draw_drawable(self.gc,self.pixmap_sel,0,0,self.orig_x,self.orig_y,size[0],size[1])<br>
+            self.pixmap_temp.draw_rectangle(self.gc_selection,False,self.orig_x,self.orig_y,size[0],size[1])<br>
+            self.pixmap_temp.draw_rectangle(self.gc_selection1,False,self.orig_x-1,self.orig_y-1,size[0]+2,size[1]+2)<br>
+<br>
+        else:<br>
+            self.pixmap.draw_pixbuf(self.gc,pix,0,0,0,0,width,height,dither=gtk.gdk.RGB_DITHER_NORMAL,x_dither=0,y_dither=0)<br>
+<br>
+        self.queue_draw()<br>
+        if not self.selmove:<br>
+            self.enableUndo(widget)<br>
<br>
     def _pixbuf2Image(self, pb):<br>
         """change a pixbuf to RGB image<br>
diff --git a/icons/invert-colors.svg b/icons/invert-colors.svg<br>
new file mode 100644<br>
index 0000000..373ca70<br>
--- /dev/null<br>
+++ b/icons/invert-colors.svg<br>
@@ -0,0 +1,387 @@<br>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><br>
+<svg<br>
+   xmlns:osb="<a href="http://www.openswatchbook.org/uri/2009/osb" target="_blank">http://www.openswatchbook.org/uri/2009/osb</a>"<br>
+   xmlns:dc="<a href="http://purl.org/dc/elements/1.1/" target="_blank">http://purl.org/dc/elements/1.1/</a>"<br>
+   xmlns:cc="<a href="http://creativecommons.org/ns#" target="_blank">http://creativecommons.org/ns#</a>"<br>
+   xmlns:rdf="<a href="http://www.w3.org/1999/02/22-rdf-syntax-ns#" target="_blank">http://www.w3.org/1999/02/22-rdf-syntax-ns#</a>"<br>
+   xmlns:svg="<a href="http://www.w3.org/2000/svg" target="_blank">http://www.w3.org/2000/svg</a>"<br>
+   xmlns="<a href="http://www.w3.org/2000/svg" target="_blank">http://www.w3.org/2000/svg</a>"<br>
+   xmlns:xlink="<a href="http://www.w3.org/1999/xlink" target="_blank">http://www.w3.org/1999/xlink</a>"<br>
+   xmlns:sodipodi="<a href="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" target="_blank">http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd</a>"<br>
+   xmlns:inkscape="<a href="http://www.inkscape.org/namespaces/inkscape" target="_blank">http://www.inkscape.org/namespaces/inkscape</a>"<br>
+   enable-background="new 0 0 55 55"<br>
+   height="55px"<br>
+   version="1.1"<br>
+   viewBox="0 0 55 55"<br>
+   width="55px"<br>
+   x="0px"<br>
+   xml:space="preserve"<br>
+   y="0px"<br>
+   id="svg2"<br>
+   inkscape:version="0.48.0 r9654"<br>
+   sodipodi:docname="invert-colors.svg"><metadata<br>
+     id="metadata50"><rdf:RDF><cc:Work<br>
+         rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type<br>
+           rdf:resource="<a href="http://purl.org/dc/dcmitype/StillImage" target="_blank">http://purl.org/dc/dcmitype/StillImage</a>" /></cc:Work></rdf:RDF></metadata><defs<br>
+     id="defs48"><inkscape:path-effect<br>
+       effect="skeletal"<br>
+       id="path-effect5822"<br>
+       is_visible="true"<br>
+       pattern="M 0,0 0,10 10,5 z"<br>
+       copytype="single_stretched"<br>
+       prop_scale="1"<br>
+       scale_y_rel="false"<br>
+       spacing="0"<br>
+       normal_offset="0"<br>
+       tang_offset="0"<br>
+       prop_units="false"<br>
+       vertical_pattern="false"<br>
+       fuse_tolerance="0" /><inkscape:path-effect<br>
+       effect="skeletal"<br>
+       id="path-effect5818"<br>
+       is_visible="true"<br>
+       pattern="M 0,0 0,10 10,5 z"<br>
+       copytype="single_stretched"<br>
+       prop_scale="1"<br>
+       scale_y_rel="false"<br>
+       spacing="0"<br>
+       normal_offset="0"<br>
+       tang_offset="0"<br>
+       prop_units="false"<br>
+       vertical_pattern="false"<br>
+       fuse_tolerance="0" /><linearGradient<br>
+       id="linearGradient5788"<br>
+       osb:paint="solid"><stop<br>
+         style="stop-color:#000000;stop-opacity:1;"<br>
+         offset="0"<br>
+         id="stop5790" /></linearGradient><linearGradient<br>
+       gradientTransform="matrix(-4.371139e-8,1,-1,-4.371139e-8,55,-4.882812e-4)"<br>
+       gradientUnits="userSpaceOnUse"<br>
+       id="SVGID_1_-0"<br>
+       x1="8.4995003"<br>
+       x2="46.5"<br>
+       y1="27.5"<br>
+       y2="27.5"><stop<br>
+         offset="0"<br>
+         style="stop-color:#FF0000"<br>
+         id="stop6-4" /><stop<br>
+         offset="0.0044"<br>
+         style="stop-color:#FF0500"<br>
+         id="stop8-8" /><stop<br>
+         offset="0.0489"<br>
+         style="stop-color:#FF3000"<br>
+         id="stop10-7" /><stop<br>
+         offset="0.092"<br>
+         style="stop-color:#FF5200"<br>
+         id="stop12-1" /><stop<br>
+         offset="0.1326"<br>
+         style="stop-color:#FF6B00"<br>
+         id="stop14-7" /><stop<br>
+         offset="0.1699"<br>
+         style="stop-color:#FF7A00"<br>
+         id="stop16-2" /><stop<br>
+         offset="0.2006"<br>
+         style="stop-color:#FF7F00"<br>
+         id="stop18-7" /><stop<br>
+         offset="0.2506"<br>
+         style="stop-color:#FF9200"<br>
+         id="stop20-2" /><stop<br>
+         offset="0.3497"<br>
+         style="stop-color:#FFB300"<br>
+         id="stop22-2" /><stop<br>
+         offset="0.4042"<br>
+         style="stop-color:#FFBF00"<br>
+         id="stop24-6" /><stop<br>
+         offset="0.4385"<br>
+         style="stop-color:#E3CA03"<br>
+         id="stop26-1" /><stop<br>
+         offset="0.5423"<br>
+         style="stop-color:#93EB0C"<br>
+         id="stop28-0" /><stop<br>
+         offset="0.5898"<br>
+         style="stop-color:#73F80F"<br>
+         id="stop30-6" /><stop<br>
+         offset="0.6159"<br>
+         style="stop-color:#6AF11D"<br>
+         id="stop32-1" /><stop<br>
+         offset="0.6649"<br>
+         style="stop-color:#54E041"<br>
+         id="stop34-5" /><stop<br>
+         offset="0.7315"<br>
+         style="stop-color:#2FC47B"<br>
+         id="stop36-9" /><stop<br>
+         offset="0.8084"<br>
+         style="stop-color:#00A0C6"<br>
+         id="stop38-4" /><stop<br>
+         offset="0.8916"<br>
+         style="stop-color:#1C64CB"<br>
+         id="stop40-9" /><stop<br>
+         offset="1"<br>
+         style="stop-color:#4210D2"<br>
+         id="stop42-0" /></linearGradient><linearGradient<br>
+       gradientTransform="matrix(-4.371139e-8,1,-1,-4.371139e-8,55,-4.882812e-4)"<br>
+       gradientUnits="userSpaceOnUse"<br>
+       id="SVGID_1_-0-1"<br>
+       x1="8.4995003"<br>
+       x2="46.5"<br>
+       y1="27.5"<br>
+       y2="27.5"><stop<br>
+         offset="0"<br>
+         style="stop-color:#FF0000"<br>
+         id="stop6-4-7" /><stop<br>
+         offset="0.0044"<br>
+         style="stop-color:#FF0500"<br>
+         id="stop8-8-5" /><stop<br>
+         offset="0.0489"<br>
+         style="stop-color:#FF3000"<br>
+         id="stop10-7-9" /><stop<br>
+         offset="0.092"<br>
+         style="stop-color:#FF5200"<br>
+         id="stop12-1-6" /><stop<br>
+         offset="0.1326"<br>
+         style="stop-color:#FF6B00"<br>
+         id="stop14-7-2" /><stop<br>
+         offset="0.1699"<br>
+         style="stop-color:#FF7A00"<br>
+         id="stop16-2-1" /><stop<br>
+         offset="0.2006"<br>
+         style="stop-color:#FF7F00"<br>
+         id="stop18-7-7" /><stop<br>
+         offset="0.2506"<br>
+         style="stop-color:#FF9200"<br>
+         id="stop20-2-8" /><stop<br>
+         offset="0.3497"<br>
+         style="stop-color:#FFB300"<br>
+         id="stop22-2-5" /><stop<br>
+         offset="0.4042"<br>
+         style="stop-color:#FFBF00"<br>
+         id="stop24-6-7" /><stop<br>
+         offset="0.4385"<br>
+         style="stop-color:#E3CA03"<br>
+         id="stop26-1-4" /><stop<br>
+         offset="0.5423"<br>
+         style="stop-color:#93EB0C"<br>
+         id="stop28-0-1" /><stop<br>
+         offset="0.5898"<br>
+         style="stop-color:#73F80F"<br>
+         id="stop30-6-8" /><stop<br>
+         offset="0.6159"<br>
+         style="stop-color:#6AF11D"<br>
+         id="stop32-1-5" /><stop<br>
+         offset="0.6649"<br>
+         style="stop-color:#54E041"<br>
+         id="stop34-5-9" /><stop<br>
+         offset="0.7315"<br>
+         style="stop-color:#2FC47B"<br>
+         id="stop36-9-7" /><stop<br>
+         offset="0.8084"<br>
+         style="stop-color:#00A0C6"<br>
+         id="stop38-4-5" /><stop<br>
+         offset="0.8916"<br>
+         style="stop-color:#1C64CB"<br>
+         id="stop40-9-3" /><stop<br>
+         offset="1"<br>
+         style="stop-color:#4210D2"<br>
+         id="stop42-0-8" /></linearGradient><linearGradient<br>
+       y2="27.5"<br>
+       x2="46.5"<br>
+       y1="27.5"<br>
+       x1="8.4995003"<br>
+       gradientTransform="matrix(-4.371139e-8,1,-1,-4.371139e-8,55,-4.882812e-4)"<br>
+       gradientUnits="userSpaceOnUse"<br>
+       id="linearGradient3454"<br>
+       xlink:href="#SVGID_1_-0-1"<br>
+       inkscape:collect="always" /><filter<br>
+       id="filter3547"<br>
+       inkscape:label="Invert"<br>
+       x="0"<br>
+       y="0"<br>
+       width="1"<br>
+       height="1"<br>
+       inkscape:menu="Color"<br>
+       inkscape:menu-tooltip="Invert colors"<br>
+       color-interpolation-filters="sRGB"><feColorMatrix<br>
+         id="feColorMatrix3549"<br>
+         type="saturate"<br>
+         values="1"<br>
+         result="fbSourceGraphic" /><feColorMatrix<br>
+         id="feColorMatrix3551"<br>
+         in="fbSourceGraphic"<br>
+         values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0 " /></filter></defs><sodipodi:namedview<br>
+     pagecolor="#ffffff"<br>
+     bordercolor="#666666"<br>
+     borderopacity="1"<br>
+     objecttolerance="10"<br>
+     gridtolerance="10"<br>
+     guidetolerance="10"<br>
+     inkscape:pageopacity="0"<br>
+     inkscape:pageshadow="2"<br>
+     inkscape:window-width="1280"<br>
+     inkscape:window-height="751"<br>
+     id="namedview46"<br>
+     showgrid="false"<br>
+     inkscape:zoom="9.7454545"<br>
+     inkscape:cx="8.7733208"<br>
+     inkscape:cy="27.5"<br>
+     inkscape:window-x="0"<br>
+     inkscape:window-y="24"<br>
+     inkscape:window-maximized="1"<br>
+     inkscape:current-layer="svg2" /><g<br>
+     transform="matrix(0.3848602,0,0,0.3848602,7.5641324,7.5767221)"<br>
+     style="display:block"<br>
+     display="block"<br>
+     id="effect-rainbow-9"><linearGradient<br>
+       gradientTransform="matrix(-4.371139e-8,1,-1,-4.371139e-8,55,-4.882812e-4)"<br>
+       gradientUnits="userSpaceOnUse"<br>
+       id="linearGradient3183"<br>
+       x1="8.4995003"<br>
+       x2="46.5"<br>
+       y1="27.5"<br>
+       y2="27.5"><stop<br>
+         offset="0"<br>
+         style="stop-color:#FF0000"<br>
+         id="stop3185" /><stop<br>
+         offset="0.0044"<br>
+         style="stop-color:#FF0500"<br>
+         id="stop3187" /><stop<br>
+         offset="0.0489"<br>
+         style="stop-color:#FF3000"<br>
+         id="stop3189" /><stop<br>
+         offset="0.092"<br>
+         style="stop-color:#FF5200"<br>
+         id="stop3191" /><stop<br>
+         offset="0.1326"<br>
+         style="stop-color:#FF6B00"<br>
+         id="stop3193" /><stop<br>
+         offset="0.1699"<br>
+         style="stop-color:#FF7A00"<br>
+         id="stop3195" /><stop<br>
+         offset="0.2006"<br>
+         style="stop-color:#FF7F00"<br>
+         id="stop3197" /><stop<br>
+         offset="0.2506"<br>
+         style="stop-color:#FF9200"<br>
+         id="stop3199" /><stop<br>
+         offset="0.3497"<br>
+         style="stop-color:#FFB300"<br>
+         id="stop3201" /><stop<br>
+         offset="0.4042"<br>
+         style="stop-color:#FFBF00"<br>
+         id="stop3203" /><stop<br>
+         offset="0.4385"<br>
+         style="stop-color:#E3CA03"<br>
+         id="stop3205" /><stop<br>
+         offset="0.5423"<br>
+         style="stop-color:#93EB0C"<br>
+         id="stop3207" /><stop<br>
+         offset="0.5898"<br>
+         style="stop-color:#73F80F"<br>
+         id="stop3209" /><stop<br>
+         offset="0.6159"<br>
+         style="stop-color:#6AF11D"<br>
+         id="stop3211" /><stop<br>
+         offset="0.6649"<br>
+         style="stop-color:#54E041"<br>
+         id="stop3213" /><stop<br>
+         offset="0.7315"<br>
+         style="stop-color:#2FC47B"<br>
+         id="stop3215" /><stop<br>
+         offset="0.8084"<br>
+         style="stop-color:#00A0C6"<br>
+         id="stop3217" /><stop<br>
+         offset="0.8916"<br>
+         style="stop-color:#1C64CB"<br>
+         id="stop3219" /><stop<br>
+         offset="1"<br>
+         style="stop-color:#4210D2"<br>
+         id="stop3221" /></linearGradient><rect<br>
+       style="fill:url(#SVGID_1_-0);stroke:#ffffff;stroke-width:3.5"<br>
+       height="38"<br>
+       width="38"<br>
+       x="8.5"<br>
+       y="8.5"<br>
+       id="rect44-1" /></g><g<br>
+     transform="matrix(0.3848602,0,0,0.3848602,26.242514,26.259729)"<br>
+     style="display:block;filter:url(#filter3547)"<br>
+     display="block"<br>
+     id="effect-rainbow-9-8"><linearGradient<br>
+       gradientTransform="matrix(-4.371139e-8,1,-1,-4.371139e-8,55,-4.882812e-4)"<br>
+       gradientUnits="userSpaceOnUse"<br>
+       id="linearGradient3183-3"<br>
+       x1="8.4995003"<br>
+       x2="46.5"<br>
+       y1="27.5"<br>
+       y2="27.5"><stop<br>
+         offset="0"<br>
+         style="stop-color:#FF0000"<br>
+         id="stop3185-1" /><stop<br>
+         offset="0.0044"<br>
+         style="stop-color:#FF0500"<br>
+         id="stop3187-8" /><stop<br>
+         offset="0.0489"<br>
+         style="stop-color:#FF3000"<br>
+         id="stop3189-9" /><stop<br>
+         offset="0.092"<br>
+         style="stop-color:#FF5200"<br>
+         id="stop3191-6" /><stop<br>
+         offset="0.1326"<br>
+         style="stop-color:#FF6B00"<br>
+         id="stop3193-4" /><stop<br>
+         offset="0.1699"<br>
+         style="stop-color:#FF7A00"<br>
+         id="stop3195-3" /><stop<br>
+         offset="0.2006"<br>
+         style="stop-color:#FF7F00"<br>
+         id="stop3197-3" /><stop<br>
+         offset="0.2506"<br>
+         style="stop-color:#FF9200"<br>
+         id="stop3199-3" /><stop<br>
+         offset="0.3497"<br>
+         style="stop-color:#FFB300"<br>
+         id="stop3201-8" /><stop<br>
+         offset="0.4042"<br>
+         style="stop-color:#FFBF00"<br>
+         id="stop3203-6" /><stop<br>
+         offset="0.4385"<br>
+         style="stop-color:#E3CA03"<br>
+         id="stop3205-0" /><stop<br>
+         offset="0.5423"<br>
+         style="stop-color:#93EB0C"<br>
+         id="stop3207-4" /><stop<br>
+         offset="0.5898"<br>
+         style="stop-color:#73F80F"<br>
+         id="stop3209-8" /><stop<br>
+         offset="0.6159"<br>
+         style="stop-color:#6AF11D"<br>
+         id="stop3211-8" /><stop<br>
+         offset="0.6649"<br>
+         style="stop-color:#54E041"<br>
+         id="stop3213-8" /><stop<br>
+         offset="0.7315"<br>
+         style="stop-color:#2FC47B"<br>
+         id="stop3215-9" /><stop<br>
+         offset="0.8084"<br>
+         style="stop-color:#00A0C6"<br>
+         id="stop3217-7" /><stop<br>
+         offset="0.8916"<br>
+         style="stop-color:#1C64CB"<br>
+         id="stop3219-7" /><stop<br>
+         offset="1"<br>
+         style="stop-color:#4210D2"<br>
+         id="stop3221-6" /></linearGradient><rect<br>
+       style="fill:url(#linearGradient3454);stroke:#ffffff;stroke-width:3.5"<br>
+       height="38"<br>
+       width="38"<br>
+       x="8.5"<br>
+       y="8.5"<br>
+       id="rect44-1-4" /></g><path<br>
+     style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:2.011;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:5.30000019;stroke-opacity:1;stroke-dasharray:none"<br>
+     d="m 29.660555,15.426382 9.395759,0 0,8.300232 0.538129,0 -0.783268,1.678014 -0.856517,-1.67529 0.553319,-0.01848 -0.108147,-7.746052 -8.70531,0 z"<br>
+     id="path5850"<br>
+     inkscape:connector-curvature="0"<br>
+     sodipodi:nodetypes="cccccccccc" /><path<br>
+     style="fill:#000000;fill-opacity:1;stroke:#ffffff;stroke-width:2.011;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"<br>
+     d="m 25.355629,39.092534 -9.395759,0 0,-8.300232 -0.538129,0 0.783268,-1.678013 0.856517,1.675289 -0.553319,0.01848 0.108147,7.746052 8.70531,0 z"<br>
+     id="path5850-9"<br>
+     inkscape:connector-curvature="0"<br>
+     sodipodi:nodetypes="cccccccccc" /></svg><br>
\ No newline at end of file<br>
diff --git a/toolbox.py b/toolbox.py<br>
index 299181b..0c3105c 100644<br>
--- a/toolbox.py<br>
+++ b/toolbox.py<br>
@@ -1230,6 +1230,8 @@ class ImageToolbar(gtk.Toolbar):<br>
 class EffectsToolbar(gtk.Toolbar):<br>
<br>
     _EFFECT_GRAYSCALE = 'grayscale'<br>
+    _INVERT_COLOR = 'invert-colors'<br>
+<br>
     # Rainbow acts as a tool in Area, and it has to be described as a dict<br>
     _EFFECT_RAINBOW = {<br>
         'name'          : 'rainbow',<br>
@@ -1256,10 +1258,16 @@ class EffectsToolbar(gtk.Toolbar):<br>
         self._effect_rainbow = DrawToolButton('effect-rainbow',activity.tool_group,_('Rainbow'))<br>
         self.insert(self._effect_rainbow, -1)<br>
         self._configure_palette(self._effect_rainbow, self._EFFECT_RAINBOW)<br>
-<br>
+<br>
+<br>
         separator = gtk.SeparatorToolItem()<br>
         self.insert(separator, -1)<br>
<br>
+        self._invert_colors = ToolButton('invert-colors')<br>
+        self.insert(self._invert_colors, -1)<br>
+        self._invert_colors.show()<br>
+        self._invert_colors.set_tooltip(_('Invert Colors'))<br>
+<br>
         """<br>
         #FIXME: Must be implemented<br>
         self._black_and_white = ToolButton('black_and_white')<br>
@@ -1267,16 +1275,11 @@ class EffectsToolbar(gtk.Toolbar):<br>
         self._black_and_white.show()<br>
         self._black_and_white.connect('clicked', test_connect, activity, 'effect-black-and-white')<br>
         self._black_and_white.set_tooltip(_('Black and White'))<br>
-<br>
-        self._invert_colors = ToolButton('invert_colors')<br>
-        self.insert(self._invert_colors, -1)<br>
-        self._invert_colors.show()<br>
-        self._invert_colors.connect('clicked', test_connect, activity, 'invert-colors')<br>
-        self._invert_colors.set_tooltip(_('Invert Colors'))<br>
-<br>
         """<br>
+<br>
         self._effect_grayscale.connect('clicked', self.grayscale)<br>
         self._effect_rainbow.connect('clicked', self.rainbow)<br>
+        self._invert_colors.connect('clicked', self.invert_colors)<br>
<br>
     ##Make the colors be in grayscale<br>
     def grayscale(self, widget):<br>
@@ -1285,6 +1288,9 @@ class EffectsToolbar(gtk.Toolbar):<br>
     ##Like the brush, but change it color when painting<br>
     def rainbow(self, widget):<br>
         self._activity.area.set_tool(self._EFFECT_RAINBOW)<br>
+<br>
+    def invert_colors(self,widget):<br>
+        self._activity.area.invert_colors(widget)<br>
<br>
         # setting cursor: moved to Area<br>
<font color="#888888"><br>
--<br>
1.7.1<br>
<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Gonzalo Odiard<br><br><br>