NickSaneColors, plugin for Tkabber, Tcl/Tk-based XMPP client software.

Most tkabber users use their own color themes, so background colors are
vastly differ. Default NickColorPool colors can flow together with user's
custom bg color. Main idea of plugin is to choose nick colors considering
the chat background color.

Human's eye perceives different colors unequally, so use weights to
calculate color distance:
D^2 = 30*(r2-r1)^2 + 59*(g2-g1)^2 + 11*(b2-b1)^2; (30 + 59 + 11 = 100)
Squared color distance threshold range
(0..429483622500): = [(0..100)*65535^2]
429483622500 is for black/white or some other inverted color pairs;
0 for exactly same colors.
So user can choose the coefficient in braces (0..100) in some range, e.g.
40..60 (this is the default).

This is simplified model, squared distance (no sqrt) between bg and fg
colors is being compared with predefined threshold range.
If calculated D^2 lays in threshold range, colors are enough
distinguishable and not overcontrasted with the background, so we use
this foreground color.
Now you can get almost similar font colors, so compare pool colors with
each other too using color-color threshold.

# This is not Delta E described in
# http://en.wikipedia.org/wiki/Color_difference
