changeset 5650:80682ac367fa

[gaim-migrate @ 6064] i got foreground colors to work with alot of patience on chipx86's part as i sent him some truely horrific colors. background color preferences are still broke. using gimp, they _appear_ to be broke the same way fgcolors were, but the same fix doesn't seem to change the resulting color, as you can see with this code. committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Mon, 02 Jun 2003 05:17:17 +0000
parents 84221116b28e
children 20ce7928c0b9
files src/gaimrc.c
diffstat 1 files changed, 14 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/gaimrc.c	Mon Jun 02 05:08:02 2003 +0000
+++ b/src/gaimrc.c	Mon Jun 02 05:17:17 2003 +0000
@@ -922,22 +922,30 @@
 			gaim_prefs_set_int("/gaim/gtk/conversations/font_size", atoi(p->value[0]));
 		} else if (!strcmp(p->option, "foreground")) {
 			char buf[8];
+
+			/*this is totally counter intuitive. why would you read in 2 before 1? 
+			 *because gaim 0.6x stored it badly, and to get the intended color
+			 *we have to read it in equally oddly.
+			 * --luke
+			 */
+
 			fgcolor.red = atoi(p->value[0]);
-			fgcolor.green = atoi(p->value[1]);
 			fgcolor.blue = atoi(p->value[2]);
+			fgcolor.green = atoi(p->value[1]);
 
-			g_snprintf(buf, sizeof(buf), "#%2x%2x%2x",
-					   atoi(p->value[0]), atoi(p->value[1]), atoi(p->value[2]));
+			g_snprintf(buf, sizeof(buf), "#%02x%02x%02x",
+					   atoi(p->value[0]), atoi(p->value[2]), atoi(p->value[1]));
 			gaim_prefs_set_string("/gaim/gtk/conversations/fgcolor", buf);
 
 		} else if (!strcmp(p->option, "background")) {
 			char buf[8];
+
 			bgcolor.red = atoi(p->value[0]);
-			bgcolor.green = atoi(p->value[1]);
 			bgcolor.blue = atoi(p->value[2]);
+			bgcolor.green = atoi(p->value[1]);
 
-			g_snprintf(buf, sizeof(buf), "#%2x%2x%2x",
-					   atoi(p->value[0]), atoi(p->value[1]), atoi(p->value[2]));
+			g_snprintf(buf, sizeof(buf), "#%02x%02x%02x",
+					   atoi(p->value[0]), atoi(p->value[2]), atoi(p->value[1]));
 			gaim_prefs_set_string("/gaim/gtk/conversations/bgcolor", buf);
 
 		} else if (!strcmp(p->option, "report_idle")) {