Hsluv
hsluv.Hsluv (Class)
Human-friendly HSL conversion utility class.
The math for most of this module was taken from:
http://www.easyrgb.com
http://www.brucelindbloom.com
Wikipedia
All numbers below taken from math/bounds.wxm wxMaxima file. We use 17
digits of decimal precision to export the numbers, effectively exporting
them as double precision IEEE 754 floats.
"If an IEEE 754 double precision is converted to a decimal string with at
least 17 significant digits and then converted back to double, then the
final number must match the original"
Source: https://en.wikipedia.org/wiki/Double-precision_floating-point_format
Static Members
For a given lightness, return a list of 6 lines in slope-intercept
form that represent the bounds in CIELUV, stepping over which will
push a value out of the RGB gamut
For given lightness, returns the maximum chroma. Keeping the chroma value
below this number will ensure that for any hue, the color is within the RGB
gamut.
XYZ coordinates are ranging in [0;1] and RGB coordinates in [0;1] range.
Name |
Type |
Default |
Description |
tuple |
Array<Float> |
|
An array containing the color's X,Y and Z values. |
result |
Array<Float> |
(optional) |
A pre-allocated array to store the result into. |
Returns |
Description |
Array<Float> |
An array containing the resulting color's red, green and blue. |
RGB coordinates are ranging in [0;1] and XYZ coordinates in [0;1].
Name |
Type |
Default |
Description |
tuple |
Array<Float> |
|
An array containing the color's R,G,B values. |
result |
Array<Float> |
(optional) |
A pre-allocated array to store the result into. |
Returns |
Description |
Array<Float> |
An array containing the resulting color's XYZ coordinates. |
XYZ coordinates are ranging in [0;1].
Name |
Type |
Default |
Description |
tuple |
Array<Float> |
|
An array containing the color's X,Y,Z values. |
result |
Array<Float> |
(optional) |
A pre-allocated array to store the result into. |
Returns |
Description |
Array<Float> |
An array containing the resulting color's LUV coordinates. |
XYZ coordinates are ranging in [0;1].
Name |
Type |
Default |
Description |
tuple |
Array<Float> |
|
An array containing the color's L,U,V values. |
result |
Array<Float> |
(optional) |
A pre-allocated array to store the result into. |
Returns |
Description |
Array<Float> |
An array containing the resulting color's XYZ coordinates. |
Name |
Type |
Default |
Description |
tuple |
Array<Float> |
|
An array containing the color's L,U,V values. |
result |
Array<Float> |
(optional) |
A pre-allocated array to store the result into. |
Returns |
Description |
Array<Float> |
An array containing the resulting color's LCH coordinates. |
Name |
Type |
Default |
Description |
tuple |
Array<Float> |
|
An array containing the color's L,C,H values. |
result |
Array<Float> |
(optional) |
A pre-allocated array to store the result into. |
Returns |
Description |
Array<Float> |
An array containing the resulting color's LUV coordinates. |
HSLuv values are ranging in [0;360], [0;100] and [0;100].
Name |
Type |
Default |
Description |
tuple |
Array<Float> |
|
An array containing the color's H,S,L values in HSLuv color space. |
result |
Array<Float> |
(optional) |
A pre-allocated array to store the result into. |
Returns |
Description |
Array<Float> |
An array containing the resulting color's LCH coordinates. |
HSLuv values are ranging in [0;360], [0;100] and [0;100].
Name |
Type |
Default |
Description |
tuple |
Array<Float> |
|
An array containing the color's LCH values. |
result |
Array<Float> |
(optional) |
A pre-allocated array to store the result into. |
Returns |
Description |
Array<Float> |
An array containing the resulting color's HSL coordinates in HSLuv color space. |
HSLuv values are in [0;360], [0;100] and [0;100].
Name |
Type |
Description |
tuple |
Array<Float> |
An array containing the color's H,S,L values in HPLuv (pastel variant) color space. |
Returns |
Description |
Array<Float> |
An array containing the resulting color's LCH coordinates. |
HSLuv values are ranging in [0;360], [0;100] and [0;100].
Name |
Type |
Description |
tuple |
Array<Float> |
An array containing the color's LCH values. |
Returns |
Description |
Array<Float> |
An array containing the resulting color's HSL coordinates in HPLuv (pastel variant) color space. |
RGB values are ranging in [0;1].
Name |
Type |
Description |
tuple |
Array<Float> |
An array containing the color's RGB values. |
Returns |
Description |
String |
A string containing a #RRGGBB representation of given color. |
RGB values are ranging in [0;1].
Name |
Type |
Description |
hex |
String |
A #RRGGBB representation of a color. |
Returns |
Description |
Array<Float> |
An array containing the color's RGB values. |
RGB values are ranging in [0;1].
Name |
Type |
Default |
Description |
tuple |
Array<Float> |
|
An array containing the color's LCH values. |
result |
Array<Float> |
(optional) |
A pre-allocated array to store the result into. |
Returns |
Description |
Array<Float> |
An array containing the resulting color's RGB coordinates. |
RGB values are ranging in [0;1].
Name |
Type |
Default |
Description |
tuple |
Array<Float> |
|
An array containing the color's RGB values. |
result |
Array<Float> |
(optional) |
A pre-allocated array to store the result into. |
Returns |
Description |
Array<Float> |
An array containing the resulting color's LCH coordinates. |
HSLuv values are ranging in [0;360], [0;100] and [0;100] and RGB in [0;1].
Name |
Type |
Default |
Description |
tuple |
Array<Float> |
|
An array containing the color's HSL values in HSLuv color space. |
result |
Array<Float> |
(optional) |
A pre-allocated array to store the result into. |
Returns |
Description |
Array<Float> |
An array containing the resulting color's RGB coordinates. |
HSLuv values are ranging in [0;360], [0;100] and [0;100] and RGB in [0;1].
Name |
Type |
Default |
Description |
tuple |
Array<Float> |
|
An array containing the color's RGB coordinates. |
result |
Array<Float> |
(optional) |
A pre-allocated array to store the result into. |
Returns |
Description |
Array<Float> |
An array containing the resulting color's HSL coordinates in HSLuv color space. |
HSLuv values are ranging in [0;360], [0;100] and [0;100] and RGB in [0;1].
Name |
Type |
Description |
tuple |
Array<Float> |
An array containing the color's HSL values in HPLuv (pastel variant) color space. |
Returns |
Description |
Array<Float> |
An array containing the resulting color's RGB coordinates. |
HSLuv values are ranging in [0;360], [0;100] and [0;100] and RGB in [0;1].
Name |
Type |
Description |
tuple |
Array<Float> |
An array containing the color's RGB coordinates. |
Returns |
Description |
Array<Float> |
An array containing the resulting color's HSL coordinates in HPLuv (pastel variant) color space. |
HSLuv values are ranging in [0;360], [0;100] and [0;100] and RGB in [0;1].
Name |
Type |
Description |
tuple |
Array<Float> |
An array containing the color's HSL values in HSLuv color space. |
Returns |
Description |
String |
A string containing a #RRGGBB representation of given color. |
HSLuv values are ranging in [0;360], [0;100] and [0;100] and RGB in [0;1].
Returns |
Description |
Array<Float> |
An array containing the color's HSL values in HSLuv color space. |
HSLuv values are ranging in [0;360], [0;100] and [0;100] and RGB in [0;1].
Returns |
Description |
Array<Float> |
An array containing the color's HSL values in HPLuv (pastel variant) color space. |
Private Members