restyle tags

This commit is contained in:
2022-01-28 21:05:54 -05:00
parent e2c8484742
commit e4522e4a89
5 changed files with 85 additions and 78 deletions

View File

@ -108,4 +108,18 @@ defmodule Cannery.Tags do
def change_tag(tag, attrs \\ %{}) do
Tag.changeset(tag, attrs)
end
@doc """
Get a random tag bg_color in `#ffffff` hex format
## Examples
iex> random_color()
"#cc0066"
"""
@spec random_bg_color() :: <<_::7>>
def random_bg_color do
["#cc0066", "#ff6699", "#6666ff", "#0066cc", "#00cc66", "#669900", "#ff9900", "#996633"]
|> Enum.random()
end
end