# HG changeset patch # User Sean Egan # Date 1033074186 0 # Node ID 1f026237d8199bd30e7d50b53f980b1a8ecaa978 # Parent 4d70a24c0fd624e129575ee74dd879c96d792942 [gaim-migrate @ 3649] color selector works now. committer: Tailor Script diff -r 4d70a24c0fd6 -r 1f026237d819 src/dialogs.c --- a/src/dialogs.c Thu Sep 26 16:51:46 2002 +0000 +++ b/src/dialogs.c Thu Sep 26 21:03:06 2002 +0000 @@ -3025,22 +3025,21 @@ void do_fgcolor(GtkWidget *widget, GtkColorSelection *colorsel) { - gdouble color[3]; GdkColor text_color; struct conversation *c; char *open_tag; open_tag = g_malloc(30); - gtk_color_selection_get_color(colorsel, color); + gtk_color_selection_get_current_color(colorsel, &text_color); c = gtk_object_get_user_data(GTK_OBJECT(colorsel)); /* GTK_IS_EDITABLE(c->entry); huh? */ - text_color.red = ((guint16)(color[0] * 65535)) >> 8; - text_color.green = ((guint16)(color[1] * 65535)) >> 8; - text_color.blue = ((guint16)(color[2] * 65535)) >> 8; - + text_color.red = text_color.red * 256 / 65535; + text_color.green = text_color.green * 256 /65535; + text_color.blue = text_color.blue * 256 / 65535; + c->fgcol = text_color; c->hasfg = 1; g_snprintf(open_tag, 23, "", text_color.red, text_color.green, @@ -3053,21 +3052,20 @@ void do_bgcolor(GtkWidget *widget, GtkColorSelection *colorsel) { - gdouble color[3]; GdkColor text_color; struct conversation *c; char *open_tag; open_tag = g_malloc(30); - gtk_color_selection_get_color(colorsel, color); + gtk_color_selection_get_current_color(colorsel, &text_color); c = gtk_object_get_user_data(GTK_OBJECT(colorsel)); /* GTK_IS_EDITABLE(c->entry); huh? */ - text_color.red = ((guint16)(color[0] * 65535)) >> 8; - text_color.green = ((guint16)(color[1] * 65535)) >> 8; - text_color.blue = ((guint16)(color[2] * 65535)) >> 8; + text_color.red = text_color.red * 256 / 65535; + text_color.green = text_color.green * 256 /65535; + text_color.blue = text_color.blue * 256 / 65535; c->bgcol = text_color; c->hasbg = 1;