Only 2 of possible 16 colors are used.
How is that a problem? There are only two people in the channel, so why whould you want to use more than two colours? People already in the channel when you start would be considered as people joining when they talk and have no colour assigned to them.

The problem is, that the contrast is not maximized. calc_color distributes all colors evenly over the whole color space. Example:

If calc_color thinks there exist only two different persons, it will produce (e.g.) the colors #000000 and #ffffff. But if we tell calc_color that there're 16 different persons, we'll get #000000 and #111111. So, the contrast is not the maximum possible contrast.

Then use 32 colours instead of 16. And if 32 people are talking at the same time, I don't think colours are going to help you much.

True, haven't thought about that. So, Jaad's and davido's solutions fulfil their purpose -- Color nicks fast. If there're more people that available colors, that's a. bad luck and b. very unlikely.

I just noticed that the case of not-using-all-available-colors is rare, too. So, it seems the pool-solutions are actually better than I first thought, thanks again Jaad and davido!


In reply to Re^4: Coloring IRC logs nicely by iblech
in thread Coloring IRC logs nicely by iblech

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.