HSLuv (HSLuv v0.2.1) View Source
Convert colors between HSLuv and RGB color spaces
Link to this section Summary
Functions
Create an HSLuv color from values
Create an HSLuv color from RGB values
Convert RGB to HSLuv.
Convert HSLuv to RGB.
Link to this section Functions
Create an HSLuv color from values
Both integer and floats are supported.
h
must be between 0 and 360 includeds
must be between 0 and 100 includedl
must be between 0 and 100 included
Create an HSLuv color from RGB values
Both integer and floats are supported.
r
must be between 0 and 255 includedg
must be between 0 and 255 includedb
must be between 0 and 255 included
Examples
iex> HSLuv.rgb(200, 150, 20)
%HSLuv{h: 57.26077539223336, l: 65.07659371178795, s: 97.61326139925325}
Convert RGB to HSLuv.
Examples
iex> HSLuv.to_hsluv(20, 50, 20)
{127.71501294923954, 67.94319276530133, 17.829530512200364}
Convert HSLuv to RGB.
h
must be between 0 and 360 includeds
must be between 0 and 100 includedl
must be between 0 and 100 included
Returned components are between 0 and 255 included
Examples
iex> HSLuv.to_rgb(20, 50, 20)
{75, 38, 31}