Hash string into RGB color

后端 未结 5 1824
无人及你
无人及你 2021-01-30 08:32

Is there a best practice on how to hash an arbitrary string into a RGB color value? Or to be more general: to 3 bytes.

You\'re asking: When will I ever need this? It doe

5条回答
  •  梦如初夏
    2021-01-30 09:22

    I just build a JavaScript library named color-hash, which can generate color based on the given string (using HSL color space and BKDRHash).

    Repo: https://github.com/zenozeng/color-hash
    Demo: https://zenozeng.github.io/color-hash/demo/

提交回复
热议问题