--- from-cvs/gimp/plug-ins/pygimp/pygimp-colors.c	Sun Sep 17 12:31:33 2006
+++ my-gtk/gimp/plug-ins/pygimp/pygimp-colors.c	Sat Oct 07 17:05:05 2006
@@ -520,12 +520,34 @@
     }
 }
 
+static PyObject *
+rgb_slice(PyObject* self, int i, int j)
+{
+  PyObject *ret;
+  int len = rgb_length(self);
+
+  /* j maybe negative */
+  if (j <= 0)
+    j = len - 1 + j;
+  /* j may be rather huge [:] ^= 0:0x7FFFFFFF */
+  else if (j > len - 1)
+    j = len - 1;
+  g_print ("slicing [%d:%d]\n", i, j);
+  ret = PyTuple_New(j - i + 1);
+  if (ret) {
+    int k;
+    for (k = i; k <= j && k < len; k++)
+      PyTuple_SetItem(ret, k - i, rgb_getitem(self, k)); 
+  }
+  return ret;
+}
+
 static PySequenceMethods rgb_as_sequence = {
     (inquiry)rgb_length,
     (binaryfunc)0,
     (intargfunc)0,
     (intargfunc)rgb_getitem,
-    (intintargfunc)0,
+    (intintargfunc)rgb_slice, /*sq_slice*/
     (intobjargproc)rgb_setitem,
     (intintobjargproc)0,
     (objobjproc)0,
