3

发布一个小包 color_hash

 2 years ago
source link: https://segmentfault.com/a/1190000041454127
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

color_hash

  • npm 位置 @wingdust/color_hash
  • color_hash 是对 color-hash 中一个字符串映射一个颜色的特性的克隆
  • color_hash 纯函数实现,使用
  • color_hash 是 Rust wasm 实现 (color-hash 是 TypeScript实现)
  • color_hash 不支持自定义,除非修改源码并自行编译,(保持特性简单)
  • color_hash 使用了一点函数式技巧

对 Rust 使用者 (也可以使用)

当你有需求:
给你一个字符串(各不相同)返回不相同的颜色时,可以来尝试这个包

仓库 color_hash 中有与 vite 的实例测试


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK