GNOME Bugzilla – Bug 434991
pango_color_parse() should accept color format "rgb:RR/GG/BB"
Last modified: 2008-05-24 16:52:49 UTC
[ Forwarded from http://bugs.debian.org/296939 ] "In trying to port wmakerconf from GTK+ 1.2 to GTK+ 2.x, I have come across the problem that wmakerconf no longer understands color strings of the format rgb:RR/GG/BB (where RR, GG and BB are integers in hex format). The reason is that gdk_color_parse() was formerly a wrapper around XParseColor() and is now a wrapper around pango_color_parse(). Further investigation reveals that pango_color_parse() has no mechanism to understand this format of color specification. This is annoying for two reasons: first, functionality present in an earlier version of GTK+ has been lost for no good reason. Second, the GTK+ API reference for version 2.8 is now misleading, since it untruthfully states of gdk_color_parse(): The text string can be in any of the forms accepted by XParseColor. Please add back this functionality to pango_color_parse(). I'll submit a patch myself if I have time in the next few days; otherwise, it doesn't seem like a difficult job." and "I've spent a few minutes to write the long-ago promised patch, in case you want to submit it upstream. However, by this point I guess any package that was going to be ported to gtk+2 already has been, so the pango maintainers should feel free to downgrade this bug to "wishlist" or close it if they want." I'm attaching the patch, written by Kevin B. McCarty <kmccarty@Princeton.EDU>.
Created attachment 87355 [details] [review] patch for rgb:RR/GG/BB
What is keeping you from calling XParseColor in wmakerconf? Things will work better if you are using the same parsing function as WindowMaker itself. The particular form discussed here is just one of a large number of similar forms accepted by XParseColor(), I would suggest rejecting this patch.
In that case we should fix the gdk_color_parse() docs to say which format is accepted by the function instead of saying it supports everything that XParseColor() supports.
Yeah, the docs could use improvement there. They haven't been correct since GTK+-1.2.
Rejecting patch because its proposed solution was not accepted.
Created attachment 109601 [details] [review] Fix documentation for gdk_color_parse () Patch to fix documentation for gdk_color_parse(). Describe the color parsing syntax exactly like pango_color_parse().
Thanks, please commit.
Committed in r20135: 2008-05-24 Björn Lindqvist <bjourne@gmail.com> * gdk/gdkcolor.c (gdk_color_parse): Update docstring to match pango_color_parse, do not reference XParseColor forms (#434991).