colorhash: Generate a color for a hashable object.

[ bsd3, library, web ] [ Propose Tags ] [ Report a vulnerability ]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.2.0.0
Change log CHANGELOG.md
Dependencies base (>=4.7 && <5), colour (>=0.0.0), hashable (>=1.0) [details]
License BSD-3-Clause
Copyright 2025
Author Willem Van Onsem
Maintainer yourfriends@hapytex.eu
Category Web
Home page https://github.com/hapytex/colorhash#readme
Source repo head: git clone https://github.com/hapytex/colorhash
Uploaded by wvanonsem90 at 2025-06-01T18:03:37Z
Distributions
Downloads 6 total (6 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2025-06-01 [all 1 reports]

Readme for colorhash-0.2.0.0

[back to package description]

colorhash

Build Status of the package by GitHub actions Hackage version badge

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.

You can contact the package maintainer by sending a mail to yourfriends@hapytex.eu.