color parsing confusion
- From: Jan-Marek Glogowski <glogow stud fbi fh-darmstadt de>
- To: gtk-devel-list gnome org
- Subject: color parsing confusion
- Date: Sat, 20 Sep 2003 08:49:28 +0200 (CEST)
Hi
I'm porting my app from Gtk+ 1.2 to Gtk+ 2.
With Gtk+ 1 I used "rgb:r/g/b" strings to store the colors, but Gtk+ 2
can't parse them in contrast to the GDK documentation. This is my trace:
GDK HTML-API: gdk_color_alloc - "any of the forms accepted by XParseColor"
Code: gdk_color_parse -> pango_color_parse
Pango HTML-API: pango_color_parse - "from the X11 rgb.txt" or "hex value"
(#rgb ...)
Code: "from Tk" -> parses "hex" (#rgb) and does a lookup in an
internal "rgb.txt" list
man XParseColor:
Parses the "following syntax: rgb:<red>/<green>/<blue>"
#rgb: "For backward compatibility" "but its continued use is not
encouraged."
Code: Just had a quick look (Xcms) ...
The X man page was my original info to decide the format.
Q: What is the preferred fix?
1. Correct the GDK HTML API
2. Add rgb / rgbi parsing to pango_color_parse
3. On X11 based platforms use XParseColor
Thanks for any comments
Jan-Marek
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]