I tried to do a 'what-if' test using the contrast formula at
https://ux.stackexchange.com/questions/107318/formula-for-color-contrast-between-text-and-background
and it looks like that's how the random color palette is currently being chosen. It appears that the blue/black combos I mentioned in the prior post are caused because the random nick colors use the color indexes with scores of approx 2.3 or higher. The formula at the url seems less accurate when blue is involved either as the foreground or background. Index 60 and mIRC Classic's index 12 both have scores of approx 2.4 against a black background, which is barely higher than the 2.3 selection cutoff.

//echo -a $contrast(1,12) $contrast(1,60)

Also, against blackground, the formula gives 12 and 60 slightly better contrast scores than index 29, but 29 is much easier to read than the others. Similarly, 74 and 84 have very similar scores against white, but 74 is much easier to see than 84.

Perhaps someone else more familiar with luminosity/contrast formulas could suggest a better tweak of the formulas generating the contrast score, but perhaps a configuration option where people can indicate which minimum contrast score they wish to use. People with different eye compatibility can choose between having more random colors, or fewer colors which tend to exclude colors harder to see against the chosen background. By bumping the cutoff score from 2.3 up to 2.5, that eliminates several poor contrast combos like:

//echo -a $chr(3) $+ 12,1 test12 $chr(3) $+ 12,1 test60 $chr(3) $+ 84,0 test84

For the alias below, "/test_contrast 2.3" imitates the colors I see currently chosen for white and blackgrounds. "/test_contrast 2.5" shows an alternate colors choice where a black background doesn't choose the hard-to-see blues.

"/test_contrast 2.5 999" includes the option where it looks for close matches between 0-15 and 16-98. It currently tosses the higher index number instead of whichever has the better contrast.

The $lum and $brightness aliases are borrowed from the Xpalette forum post.

Code
; $1 is index 0-98
alias Lum {
  tokenize 44 $rgb($color($1))
  return $calc(0.2126 * $brightness($1) + 0.7152 * $brightness($2) + 0.0722* $brightness($3))
}
alias brightness {
  var %res = $1 / 255
  return $iif(%res <= 0.03928, $calc(%res / 12.92), $calc((( %res + 0.055) / 1.055) ^ 2.4))
}

; $1 and $2 are 2 color indexes 0-98
alias contrast {
  var %a k0,x color x k1,x color x k0,y color y k1,y color y . kx,y color x on y ky,x color y on x .
  echo -s $replace(%a,k,$chr(3),x,$1,y,$2)
  clipboard $replace(%a,k,$chr(3),x,0,y,1)
  tokenize 32 $sorttok($Lum($1) $Lum($2),32,nr)
  return $calc( ($1 + 0.05) / ($2 + 0.05) )
}

; any channel with many nicks will do
alias test_contrast {
  var %chan #freenode , %t $nick(%chan,0) , %i 0 , %nick.buckets $str(0 $chr(32),99)
  while (%i < %t) {
    inc %i | var %n $nick(%chan,%i) , %c $nick(%chan,%i).color , %c2 %c + 1
    var %new.val $gettok(%nick.buckets,%c2,32) + 1 , %nick.buckets $puttok(%nick.buckets,%new.val,%c2,32)
    ; next line just shows everyone having same color as yourself
    ; if (%c == $nick(%chan,$me).color) echo -s %n %c
  }
  var %bg $color(background) , %fg $color(normal) , %rgb.taken $color(%bg) , %lum.bg $lum(%bg) , %rgb.0-15
  var %threshhold 2.3 | if ($1 isnum 0-) var %threshhold $1
  var %min.dist 0     | if ($2 isnum 0-) var %min.dist $2
  var %i 0 , %yes.now , %nno.now $chr(3) $+ 0 $+ , $+ %bg , %alt.yes , %alt.nno %nno.now , %lum.array
  while (%i < 99) {
    var %j = %i + 1
    var %lum.i $lum(%i) , %lum.array %lum.array %lum.i
    if ($istok(%rgb,$color(%i),32) ) { echo -s toss %i is a dupe | inc %i | continue }
    var %rgb %rgb $color(%i)
    var %tmp $sorttok( %lum.i %lum.bg ,32,nr)
    var %tmp $calc( ( $gettok(%tmp,1,32) + 0.05) / ($gettok(%tmp,2,32) + 0.05) )

    if (%min.dist) {
      if (%i < 16) var %rgb.0-15 %rgb.0-15 $rgb($color(%i))
      else {
        var %c 1 | while (%c isnum 1-16) {
          tokenize 44 $gettok(%rgb.0-15,%c,32) $+ , $+ $rgb($color(%i))
          var %dist $calc( ($1 - $4)^2 + ($2 - $5)^2 + ($3 - $6)^2 )
          if (%dist < %min.dist) { var %tmp , %diff $v1 | break }
        inc %c }
      }
    }

    if (%tmp == $null) { echo -s toss %i close to $calc(%c -1) . $rgb($color(%i)) vs $rgb($color($calc(%c -1))) . dist %dist | inc %i | continue }
    var %label $+($chr(3),%i,test,%i,=,%tmp)
    if ($gettok(%nick.buckets,%j,32) == 0) var %nno.now %nno.now %label , %nno.contrasts %nno.contrasts %tmp
    else                                   var %yes.now %yes.now %label , %yes.contrasts %yes.contrasts %tmp
    if (%tmp > %threshhold)                var %alt.yes %alt.yes %label
    else                                   var %alt.nno %alt.nno %label
    inc %i
  }
  echo -s ===== nicks in use: color|nick_count|luminosity
  echo -s background: %bg zeroes: $wildtok(%nick.buckets,0,0,32) of 99 total: %t : $regsubex(foo,%nick.buckets,/(\S+)/g,$+($calc(\n -1),:,\t $+ $chr(22) $+ $round($gettok(%lum.array,\n,32),3) $+ $chr(22) ,$chr(32)))
  ;echo -s ===== sorted contrasts vs background
  ;echo -s yes.contrasts: $sorttok(%yes.contrasts,32,n)
  ;echo -s nno.contrasts: $sorttok(%nno.contrasts,32,n)
  echo -s ===== colors     used and their contrast vs background
  echo -s $numtok(%yes.now,32) now.yes: %yes.now
  echo -s ===== colors NOT used and their contrast vs background
  echo -s $numtok(%nno.now,32) now.nno: %nno.now
  clipboard %nno.now
  if (%threshhold != 2.3) {
    echo -s ===== what-if colors and their contrast vs background contrast: score > %threshhold
    echo -s $numtok(%alt.yes,32) alt.yes: %alt.yes
    echo -s $numtok(%alt.nno,32) alt.nno: %alt.nno
  }
  echo -s ===== $ $+ 1 == optional min contrast score (default 2.3) $ $+ 2 = optional 16-98 min distance vs 0-15 RGB (default 0 suggest 1000)
}
; $1 and $2 are index 0-98
alias distance {
  tokenize 44 $rgb($color($1)) $+ , $+ $rgb($color($2))
  return $calc( ($1 - $4)^2 + ($2 - $5)^2 + ($3 - $6)^2 )
}