HSLuv library for elixir
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Nicolas Goy 896630bb49 Return non normalized RGB values for consistency with input 2 weeks ago
lib Return non normalized RGB values for consistency with input 2 weeks ago
test Initial version 2 weeks ago
.formatter.exs Initial version 2 weeks ago
.gitignore Initial version 2 weeks ago
LICENSE-APACHE Initial version 2 weeks ago
LICENSE-MIT Initial version 2 weeks ago
Makefile Add metadata 2 weeks ago
README.md HSLuv link 2 weeks ago
mix.exs Return non normalized RGB values for consistency with input 2 weeks ago
mix.lock Add docs dependency 2 weeks ago

README.md

HSLuv

Elixir library to convert RGB to HSLuv and vice versa.

HSLuv is a color space for easy color manipulation in perceptual space.

https://www.hsluv.org/

Installation

If available in Hex, the package can be installed by adding hsluv to your list of dependencies in mix.exs:

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

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/hsluv.

Example

# Create an HSLuv color from RGB values (0-255)
iex> HSLuv.rgb(200, 150, 20)
%HSLuv{h: 57.26077539223336, l: 65.07659371178795, s: 97.61326139925325}

# Convert RGB to HSLuv tuple (0-255)
iex> HSLuv.to_rgb(20, 50, 20)
{0.2934644509325827, 0.14978226541818696, 0.12310538660115919}

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.