frontend/utils/generateIrcColor.ts
JustTemmie 9b7de48c02
Some checks failed
ci/woodpecker/push/build-and-publish Pipeline failed
feat: add IRC colours, without a toggle for now
2025-07-13 18:16:02 +02:00

12 lines
No EOL
260 B
TypeScript

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}%)`
}