about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2025-10-28 21:46:38 -0400
committerJune McEnroe <june@causal.agency>2025-10-28 21:46:38 -0400
commit073682e29672610f840cb67cf1b8b5e8decbf36c (patch)
tree9afb03eb3bb59044720594a62e5f04a09c0feaa4
parentAdd /motd command (diff)
downloadcatgirl-073682e29672610f840cb67cf1b8b5e8decbf36c.tar.gz
catgirl-073682e29672610f840cb67cf1b8b5e8decbf36c.zip
Allow colour hashing to pick white
This changes all the colours sadly. Oh well. One must deal with
change in life.
-rw-r--r--chat.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/chat.h b/chat.h
index 32ba74a..bd69b5e 100644
--- a/chat.h
+++ b/chat.h
@@ -147,8 +147,9 @@ static inline uint32_t _hash(const char *str) {
 	return hash;
 }
 static inline enum Color hash(const char *str) {
-	if (hashBound < Blue) return Default;
-	return Blue + _hash(str) % (hashBound + 1 - Blue);
+	if (!hashBound) return Default;
+	enum Color color = Black + _hash(str) % (hashBound + 1 - Black);
+	return (color == Black ? White : color);
 }
 
 extern struct Network {
'2017-07-04 21:11:09 -0400'>2017-07-04Generalize C-w neovim terminal mappingJune McEnroe 2017-07-04Remove tmuxJune McEnroe 2017-07-04Show terminal title in statuslineJune McEnroe 2017-07-04Add nvim terminal mappingsJune McEnroe 2017-06-29Add color to xxJune McEnroe 2017-06-28Set tmux copy-mode-vi bindings for TarmakJune McEnroe 2017-06-27Link Scala syntax fileJune McEnroe 2017-06-27Clean up top of trivial colorscheme fileJune McEnroe 2017-06-27Fix Scala syntax highlight linksJune McEnroe