diff options
| author | June McEnroe <june@causal.agency> | 2025-10-28 21:46:38 -0400 |
|---|---|---|
| committer | June McEnroe <june@causal.agency> | 2025-10-28 21:46:38 -0400 |
| commit | 073682e29672610f840cb67cf1b8b5e8decbf36c (patch) | |
| tree | 9afb03eb3bb59044720594a62e5f04a09c0feaa4 /chat.h | |
| parent | Add /motd command (diff) | |
| download | catgirl-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.
Diffstat (limited to '')
| -rw-r--r-- | chat.h | 5 |
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 { |