GNOME Bugzilla – Bug 360423
sequence interface on color incomplete
Last modified: 2006-10-11 06:02:00 UTC
some of my (old) pygimp scripts are using a simple way to write colors to HTML, see traceback below, where bcolor is a gimpcolor.RGB passed into the script by PF_COLOR (255,255,255). I could not find a completely compatible way to recover the sequence facility, so I tried: # we are only interested in rgb, not a bcolor = bcolor[:2] But to make that work tp_slice needs to be supported, as in the patch following. Traceback (most recent call last):
+ Trace 75094
dialog.res = run_script(params)
return apply(function, params)
write_head(f, "Thumnails of " + sPath + sFilePattern, bcolor,bJs)
f.write ("</head>\n<body bgcolor=" + "#%2x%2x%2x" % (bcolor) + ">\n")
Created attachment 74217 [details] [review] slice interface for gimpcolor.RGB
Looks like an enhancement request to me. And your patch has debug output that should be removed before it is accepted.
I implemented both slice and subscript, so extended slice notation can be used. 2006-10-10 Manish Singh <yosh@gimp.org> * plug-ins/pygimp/pygimp-colors.c: Add slice support to the colors types. Fixes bug #360423.