/random_color

Utility for generating random colors in Elixir

Primary LanguageElixirMIT LicenseMIT

RandomColor

Elixir port of davidmerfield/randomColor

Installation

The package can be installed by adding random_color to your list of dependencies in mix.exs:

def deps do
  [
    {:random_color, "~> 0.1.0"}
  ]
end

Basic Usage

RandomColor.hex() # #13B592

RandomColor.rgb() # {189, 81, 542}
RandomColor.rgb(format: :string) # rgb(189, 81, 542)

RandomColor.hex(hue: :red) # #9B112C
RandomColor.hex(hue: :red, luminosity: :light) # #FFB2CA

RandomColor.hsla([], 0.5) # hsla(117, 65.29%, 48.4%, 0.5)

The docs can be found at https://hexdocs.pm/random_color.

License

MIT