Relax assertions on colors

As dominant colors are not stable on different environments
This commit is contained in:
Claudio Ortolina
2026-03-03 16:13:23 +00:00
parent 6d451481b7
commit 7ec3e68e58
3 changed files with 23 additions and 11 deletions
+12
View File
@@ -0,0 +1,12 @@
defmodule MusicLibrary.ColorHelpers do
@doc """
Returns true if the given string is a valid lowercase hex color code.
iex> MusicLibrary.ColorHelpers.color_hex?("#d3b696")
true
iex> MusicLibrary.ColorHelpers.color_hex?("not a color")
false
"""
def color_hex?(value), do: String.match?(value, ~r/^#[0-9a-f]{6}$/)
end