in reply to Re^2: Coloring IRC logs nicely
in thread Coloring IRC logs nicely

There's no reason why the two methods are mutually exclusive. You can retain contrast for small numbers of nicks by working out the fixed colors and then sorting them in an array so that the 3 primary colours appear first, then the 3 secondary colors, then the 6 tertiary colors, etc.
@colors = qw(ff0000 00ff00 0000ff ffff00 ff00ff 00ffff);
This will ensure that the first 3 nicks get a good contrast between the colors, then the next 3 get the second-best level of contrast ad infinitum.

Replies are listed 'Best First'.
Re^4: Coloring IRC logs nicely
by iblech (Friar) on Aug 20, 2004 at 15:15 UTC
    This will ensure that the first 3 nicks get a good contrast between the colors, then the next 3 get the second-best level of contrast ad infinitum.

    Yes, that's no problem. But: The first nicks are not necessarily the most active nicks, example:

    • A..F join (colors: most contrast)
    • A..F idle
    • G,H,I join (colors: less contrast)
    • G,H,I flame or are otherwise active

    To work around that, the nicks would have to be sorted for activeness -- and to do that, we'd need knowledge of all further nicks. And then, we could just use my first algorithm.