https://github.com/hapytex/colorhash
Determine a color based on the hash of an object.
https://github.com/hapytex/colorhash
color colorhash hash hashable haskell rgb
Last synced: 3 months ago
JSON representation
Determine a color based on the hash of an object.
- Host: GitHub
- URL: https://github.com/hapytex/colorhash
- Owner: hapytex
- License: bsd-3-clause
- Created: 2025-06-01T13:35:11.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-06-01T17:47:32.000Z (about 1 year ago)
- Last Synced: 2025-06-19T01:03:24.209Z (12 months ago)
- Topics: color, colorhash, hash, hashable, haskell, rgb
- Language: Haskell
- Homepage: https://hackage.haskell.org/package/colorhash
- Size: 12.1 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# colorhash
[](https://github.com/hapytex/colorhash/actions/workflows/build-ci.yml)
[](https://hackage.haskell.org/package/colorhash)
Hashes are an easy way to distinguish between two objects since it is not impossible that two random objects have the same hash, but it is very unlikely. But for humans, a hash is often still not very convenient. Colors are an easier way to distinguish. For example one can make a list of items, and give each of the items a different color based on the hash.
This module provides a function `rgbHash :: (Hashable a, Floating b, Ord b) => a -> Colour b` that can convert any `Hashable` object to a `Colour`.
## `colorhash` is *safe* Haskell
The only module, `Data.Hashable.Color` is compiled with the `Safe` pragma.
## Contribute
You can contribute by making a pull request on the [*GitHub repository*](https://github.com/hapytex/colorhash).
You can contact the package maintainer by sending a mail to [`yourfriends@hapytex.eu`](mailto:yourfriends@hapytex.eu).