I ported a js lib colour_hash to get an assigned color of a string.


The idea is to be able to assign a colour to a user or concept that is inline with your current key colours

A port of https://github.com/zenozeng/color-hash


iex> ColourHash.hex("test")
iex> ColourHash.rgb("test")
{24, 108, 224}
iex> ColourHash.hsl("test")
{274, 0.65, 0.65}
iex> ColourHash.hex("test", %{lightness: [0.1], saturation: [0.1, 0.9], hue_range: %{min: 30, max: 30} } )

Github: https://github.com/zesarone/colour_hash
Hex.pm: https://hexdocs.pm/colour_hash.

Hope you guys like it and find it useful! :slight_smile:


I already have a place where this could be useful! ^.^

1 Like