comparison src/gtkconv.c @ 11480:e9251afae7b8

[gaim-migrate @ 13722] (13:29:01) Etan Reisner (deryni): You are defining scale after you try to use it. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Fri, 09 Sep 2005 18:30:16 +0000
parents 5298197df5bd
children 16b0da1f376f
comparison
equal deleted inserted replaced
11479:5298197df5bd 11480:e9251afae7b8
124 static char *item_factory_translate_func (const char *path, gpointer func_data); 124 static char *item_factory_translate_func (const char *path, gpointer func_data);
125 125
126 static GdkColor *get_nick_color(GaimGtkConversation *gtkconv, const char *name) { 126 static GdkColor *get_nick_color(GaimGtkConversation *gtkconv, const char *name) {
127 static GdkColor col; 127 static GdkColor col;
128 GtkStyle *style = gtk_widget_get_style(gtkconv->imhtml); 128 GtkStyle *style = gtk_widget_get_style(gtkconv->imhtml);
129 float scale;
129 130
130 col = nick_colors[g_str_hash(name) % NUM_NICK_COLORS]; 131 col = nick_colors[g_str_hash(name) % NUM_NICK_COLORS];
132 scale = ((1-(LUMINANCE(style->base[GTK_STATE_NORMAL]) / LUMINANCE(style->white))) *
133 (LUMINANCE(style->white)/MAX(MAX(col.red, col.blue), col.green)));
131 134
132 /* The colors are chosen to look fine on white; we should never have to darken */ 135 /* The colors are chosen to look fine on white; we should never have to darken */
133 if (scale > 1) { 136 if (scale > 1) {
134 float scale = ((1-(LUMINANCE(style->base[GTK_STATE_NORMAL]) / LUMINANCE(style->white))) *
135 (LUMINANCE(style->white)/MAX(MAX(col.red, col.blue), col.green)));
136 col.red *= scale; 137 col.red *= scale;
137 col.green *= scale; 138 col.green *= scale;
138 col.blue *= scale; 139 col.blue *= scale;
139 } 140 }
140 141