Mercurial > pidgin
diff src/dialogs.c @ 3557:1f026237d819
[gaim-migrate @ 3649]
color selector works now.
committer: Tailor Script <tailor@pidgin.im>
| author | Sean Egan <seanegan@gmail.com> |
|---|---|
| date | Thu, 26 Sep 2002 21:03:06 +0000 |
| parents | cf00549c53d7 |
| children | bdd0bebd2d04 |
line wrap: on
line diff
--- 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, "<FONT COLOR=\"#%02X%02X%02X\">", 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;
