#rgb #hsl #converter #graphics

colorhash

A hashing function to convert text strings into colors

4 releases

0.1.3 Jan 21, 2024
0.1.2 Jan 21, 2024
0.1.1 Jan 21, 2024
0.1.0 Jan 21, 2024

#1880 in Images

Download history 23/week @ 2026-01-24 1/week @ 2026-01-31 1/week @ 2026-02-07 5/week @ 2026-03-07 184/week @ 2026-03-14 399/week @ 2026-03-21 181/week @ 2026-03-28 115/week @ 2026-04-04 243/week @ 2026-04-11 457/week @ 2026-04-18 534/week @ 2026-04-25 382/week @ 2026-05-02 297/week @ 2026-05-09

1,713 downloads per month
Used in db-tail

MIT/Apache

11KB
171 lines

colorhash

Convert a string to a color representation consistently by using a sha256 hash.

Based on color-hash for JS. Doesn't use a custom hashing function, it's always sha256.

To try out how it works:

rustup target add wasm32-unknown-unknown
cargo install trunk
cd demo-page
trunk serve

You should see a result like this:

Demo page

Dependencies

~250KB