feat: add IRC colours, without a toggle for now
Some checks failed
ci/woodpecker/push/build-and-publish Pipeline failed

This commit is contained in:
Twig 2025-07-13 18:16:02 +02:00
parent be5d65883b
commit 9b7de48c02
No known key found for this signature in database
4 changed files with 18 additions and 1 deletions

12
utils/generateIrcColor.ts Normal file
View file

@ -0,0 +1,12 @@
import xxhash from "xxhash-wasm"
const { h64 } = await xxhash()
export default (seed: string): string => {
const lightness = 50
// this should probably be cached eventually
const idHash = h64(seed)
return `hsl(${idHash % 360n}, 100%, ${lightness}%)`
}