[Pidgin] #16540: Unreadable nicks in Pidgin chat

Pidgin trac at pidgin.im
Mon Jan 19 09:09:27 EST 2015


#16540: Unreadable nicks in Pidgin chat
-------------------------+------------------------------------
 Reporter:  hb860        |      Owner:  EionRobb
     Type:  enhancement  |     Status:  new
Milestone:  2.10.12      |  Component:  unclassified
  Version:  2.10.11      |   Keywords:  chat colors formatting
-------------------------+------------------------------------
 Sometimes Pidgin picks too bright colors in conference/chat so nicks
 become unreadable on the default white background. In my case, it used
 #00FF00 for one of participants. Can we limit the color channel value to a
 half in the '''get_nick_color''' function? To get something like this:

 {{{
 static const GdkColor *get_nick_color(PidginConversation *gtkconv, const
 char *name)
 {
         static GdkColor col;
         GtkStyle *style = gtk_widget_get_style(gtkconv->imhtml);
         float scale;

         col = nick_colors[g_str_hash(name) % nbr_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) {
                 col.red   *= scale;
                 col.green *= scale;
                 col.blue  *= scale;
         }
         col.red = MIN(col.red,32767);
         col.green = MIN(col.green,32767);
         col.blue = MIN(col.blue,32767);
         return &col;
 }
 }}}

--
Ticket URL: <https://developer.pidgin.im/ticket/16540>
Pidgin <https://pidgin.im>
Pidgin


More information about the Tracker mailing list