forked from shibao/cannery
restyle tags
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user