New default sender colors!
authorShane Synan <digitalcircuit36939@gmail.com>
Fri, 2 Dec 2016 23:35:32 +0000 (17:35 -0600)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 12 Apr 2017 20:51:35 +0000 (22:51 +0200)
commit5f13dd167785d830a851b134863dce231ec450dd
tree8c990b559dcdfcdfe1504a8f0e845e38a9e3b436
parent707cd1f21f655c34a5c2b77b02832f283cb80f71
New default sender colors!

Add a full range of 16 sender colors, loosely readable and
distinguishable.

This results in less redundant nickname colors and possibly better
readability (subjective).  All changes can be undone, as expected.

Colors generated with an algorithm suggested to to the Pidgin
implementation.  Credit to 'lobais' for the original algorithm.

Bump settings minor version to preserve old sender colors.  This only
affects those who have used the git master branch,  and if desired
can be removed.

Algorithm code:
def genColor (n, startpoint=0):
    assert n >= 1
    # This splits the 0 - 1 segment in the pizza way
    h = (2*n-1)/(2**ceil(log(n)/log(2)))-1
    h = (h + startpoint) % 1
    # We set saturation based on the amount of green, in the range 0.6 to 0.8
    rgb = colorsys.hsv_to_rgb(h, 1, 1)
    rgb = colorsys.hsv_to_rgb(h, 1, (1-rgb[1])*0.2+0.6)
    return rgb

See https://developer.pidgin.im/ticket/4534#comment:4

Resolves GH-266.
src/qtui/qtuiapplication.cpp
src/qtui/settingspages/chatviewcolorsettingspage.ui
src/uisupport/uistyle.h