Emil
I ported a js lib colour_hash to get an assigned color of a string.
ColourHash
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
Examples
iex> ColourHash.hex("test")
"186CE0"
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} } )
"18171C"
Github: https://github.com/zesarone/colour_hash
Hex.pm: https://hexdocs.pm/colour_hash.
Hope you guys like it and find it useful! 
Most Liked
OvermindDL1
I already have a place where this could be useful! ^.^
2
cenotaph
thank you, I always use this function in every language
glad you have done it for elixir!
2
Popular in Libraries
Introducing assertions, the library that helps you write really great test assertions!
GitHub: https://github.com/devonestes/assertions ...
New
Hey all,
We have made an Ecto3 Adapter for SQLite3, ecto_sqlite3!
We have successfully on-boarded the full suite of integration tests (...
New
It is a well-know topic within the Elixir community: “To mock or not to mock? :)”
Every alchemist probably has his / her own opinion con...
New
Hi!
I wanted to introduce my latest project LiveSvelte. It allows you to render Svelte inside LiveView with end-to-end reactivity. It’s ...
New
Rummage.Ecto and Rummage.Phoenix provide ways to perform Searching, Sorting and Pagination over Ecto queries and Phoenix collections.
Fo...
New
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
Experimenting with this code.
OK.try do
user <- fetch_user(1)
cart <- fetch_cart(1)
order = checkout(cart, user)
save_or...
New
Hey everyone!
Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New
Let’s write a database! Well not really, but I think it’s a little sad that there doesn’t seem to be a simple in-memory distributed KV da...
New
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
New
Other popular topics
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this:
...
New
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible.
total = 10
while total != 0
...
New
Hi,
I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
I have a super simple question about elixir - how would I take a file like this
foo bar baz
and output a new file that enumerates th...
New
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including.
What is Phoenix LiveV...
New







