Open jensecj opened 3 years ago
I'd use a separate pool for fixed colors. That way it won't be depleted.
The hashing approach seems a tad clownshoes. Is it adapted from an existing solution? If not, I'd reuse something from Weechat: https://github.com/weechat/weechat/blob/master/src/gui/gui-nick.c
Might also make the code clearer to have a customizable hash function.
Adds a new variable
circe-color-nicks-persist
which causes nicknames to be colored by using their hash as an index intocirce-nick-color-pool
.There are a couple of minor foibles:
Changing the signature of
circe-nick-color-pick
breaks backwards-compatability, I have looked around and not found anyone who actually used this anywhere, so I don't think it's a major problem, could be solved by making the new argument optional.Changing
circe-color-nicks-persist
after some nicks have been popped from the pool reduces the available colors, but I don't imagine people flip-flopping the setting often.