feat: add IRC colours, without a toggle for now
Some checks failed
ci/woodpecker/push/build-and-publish Pipeline failed
Some checks failed
ci/woodpecker/push/build-and-publish Pipeline failed
This commit is contained in:
parent
be5d65883b
commit
9b7de48c02
4 changed files with 18 additions and 1 deletions
12
utils/generateIrcColor.ts
Normal file
12
utils/generateIrcColor.ts
Normal 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}%)`
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue