# HG changeset patch # User Richard Laager # Date 1126290616 0 # Node ID 7ccbb9220548d706115e3593f2e11d82dfbe7be3 # Parent 737177fdad9044a64b5f1cf0278dae5b9e2da51d [gaim-migrate @ 13722] (13:29:01) Etan Reisner (deryni): You are defining scale after you try to use it. diff -r 737177fdad90 -r 7ccbb9220548 src/gtkconv.c --- a/src/gtkconv.c Fri Sep 09 18:23:52 2005 +0000 +++ b/src/gtkconv.c Fri Sep 09 18:30:16 2005 +0000 @@ -126,13 +126,14 @@ static GdkColor *get_nick_color(GaimGtkConversation *gtkconv, const char *name) { static GdkColor col; GtkStyle *style = gtk_widget_get_style(gtkconv->imhtml); + float scale; col = nick_colors[g_str_hash(name) % NUM_NICK_COLORS]; + scale = ((1-(LUMINANCE(style->base[GTK_STATE_NORMAL]) / LUMINANCE(style->white))) * + (LUMINANCE(style->white)/MAX(MAX(col.red, col.blue), col.green))); /* The colors are chosen to look fine on white; we should never have to darken */ if (scale > 1) { - float scale = ((1-(LUMINANCE(style->base[GTK_STATE_NORMAL]) / LUMINANCE(style->white))) * - (LUMINANCE(style->white)/MAX(MAX(col.red, col.blue), col.green))); col.red *= scale; col.green *= scale; col.blue *= scale;