https://github.com/tylersamples/random_color
Utility for generating random colors in Elixir
https://github.com/tylersamples/random_color
elixir randomcolor
Last synced: 8 months ago
JSON representation
Utility for generating random colors in Elixir
- Host: GitHub
- URL: https://github.com/tylersamples/random_color
- Owner: tylersamples
- License: mit
- Created: 2021-05-04T04:05:03.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-05-08T05:33:04.000Z (about 5 years ago)
- Last Synced: 2025-10-07T01:06:48.154Z (9 months ago)
- Topics: elixir, randomcolor
- Language: Elixir
- Homepage:
- Size: 19.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RandomColor
Elixir port of [davidmerfield/randomColor](https://github.com/davidmerfield/randomColor)
## Installation
The package can be installed
by adding `random_color` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:random_color, "~> 0.1.0"}
]
end
```
## Basic Usage
```elixir
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](https://hexdocs.pm/random_color).
## License
[MIT](./LICENSE)