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)
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.


No differences found