Methods
cmykToHsl(c, m, y, k, maximumsopt) → {hsl}
This function converts a CMYK color set into HSL.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
c |
number
|
The Cyan value | ||
m |
number
|
The Magenta value | ||
y |
number
|
The Yellow value | ||
k |
number
|
The Key value | ||
maximums |
hslCmykMaximums
|
<optional> |
{ hsl: { h: 360, s: 100, l: 100 }, cmyk: { c: 1, m: 1, y: 1, k: 1 } } | The maximum values for CMYK (input) and HSL (output) |
Returns:
- Type:
-
hsl
cmykToRgb(c, m, y, k, maximumsopt) → {rgb}
This function converts a CMYK color set into RGB.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
c |
number
|
The Cyan value | ||
m |
number
|
The Magenta value | ||
y |
number
|
The Yellow value | ||
k |
number
|
The Key value | ||
maximums |
cmykRgbMaximums
|
<optional> |
{ rgb: { r: 255, g: 255, b: 255 }, cmyk: { c: 1, m: 1, y: 1, k: 1 } } | The maximum values for CMYK (input) and RGB (output) |
Returns:
- Type:
-
rgb
hexToRgb(hex, maximums) → {rgb}
This function converts from hexadecimal color into RGB.
Parameters:
| Name | Type | Description |
|---|---|---|
hex |
string
|
The hexadecimal color, in the format #XXXXXX or XXXXXX
|
maximums |
rgbMaximums
|
The RGB (output) maximum values |
Returns:
- Type:
-
rgb
hslToCmyk(h, s, l, maximumsopt) → {cmyk}
This function converts an HSL color set into CMYK.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
h |
number
|
The Hue value | ||
s |
number
|
The Saturation value | ||
l |
number
|
The Lightness value | ||
maximums |
hslCmykMaximums
|
<optional> |
{ hsl: { h: 360, s: 100, l: 100 }, cmyk: { c: 1, m: 1, y: 1, k: 1 } } | The maximum values for HSL (input) and CMYK (output) |
Returns:
- Type:
-
cmyk
hslToRgb(h, s, l, maximumsopt) → {rgb}
This function converts an HSL color set into RGB.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
h |
number
|
The Hue value | ||
s |
number
|
The Saturation value | ||
l |
number
|
The Lightness value | ||
maximums |
hslRgbMaximums
|
<optional> |
{ rgb: { r: 255, g: 255, b: 255 }, hsl: { h: 360,s: 100,l: 100 } } | The maximum values for HSL (input) and RGB (output) |
Returns:
- Type:
-
rgb
rgbToCmyk(r, g, b, maximumsopt) → {cmyk}
This function converts an RGB color set into CMYK.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
r |
number
|
The Red value | ||
g |
number
|
The Green value | ||
b |
number
|
The Blue value | ||
maximums |
cmykRgbMaximums
|
<optional> |
{ rgb: { r:255, g:255, b:255 }, cmyk: { c: 1, m: 1, y: 1,k: 1 } } | The maximum values for RGB (input) and CMYK (output) |
Returns:
- Type:
-
cmyk
rgbToHex(r, g, b, maximums) → {string}
This function converts from RGB color set into hexadecimal.
Parameters:
| Name | Type | Description |
|---|---|---|
r |
number
|
The Red value |
g |
number
|
The Green value |
b |
number
|
The Blue value |
maximums |
rgbMaximums
|
The RGB (output) maximum values |
Returns:
- Type:
-
string
rgbToHsl(r, g, b, maximumsopt) → {hsl}
This function converts an RGB color set into HSL.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
r |
number
|
The Red value | ||
g |
number
|
The Green value | ||
b |
number
|
The Blue value | ||
maximums |
hslRgbMaximums
|
<optional> |
{ rgb: { r: 255, g: 255, b: 255 }, hsl: { h: 360, s: 100, l: 100 } } | The maximum values for RGB (input) and HSL (output) |
Returns:
- Type:
-
hsl
Type Definitions
cmyk
A set of values for C, M and Y and K.
Properties:
| Name | Type | Description |
|---|---|---|
c |
number
|
The Cyan value |
m |
number
|
The Magenta value |
y |
number
|
The Yellow value |
k |
number
|
The Key value |
Type:
-
object
cmykMaximums
A set of maximum values for C, M and Y and K.
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
c |
number
|
<optional> |
1 | The Cyan maximum value |
m |
number
|
<optional> |
1 | The Magenta maximum value |
y |
number
|
<optional> |
1 | The Yellow maximum value |
k |
number
|
<optional> |
1 | The Key maximum value |
Type:
-
object
cmykRgbMaximums
A set of maximum values for CMYK and RGB.
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
cmyk |
cmykMaximums
|
<optional> |
{ c: 1, m: 1, y: 1, k: 1 } | The CMYK maximum values |
rgb |
rgbMaximums
|
<optional> |
{ r: 255, g: 255, b: 255 } | The RGB maximum values |
Type:
-
object
hsl
A set of HSL values
Properties:
| Name | Type | Description |
|---|---|---|
h |
number
|
The Hue value |
s |
number
|
The Saturation value |
l |
number
|
The Lightness value |
Type:
-
object
hslCmykMaximums
A set of maximum values for HSL and CMYK.
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
cmyk |
cmykMaximums
|
<optional> |
{ c: 1, m: 1, y: 1, k: 1 } | The CMYK maximum values |
hsl |
hslMaximums
|
<optional> |
{ h: 360, s: 100, l: 100 } | The HSL maximum values |
Type:
-
object
hslMaximums
A set of maximum values for H, S and L.
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
h |
number
|
<optional> |
360 | The Hue maximum value |
s |
number
|
<optional> |
100 | The Saturation maximum value |
l |
number
|
<optional> |
100 | The Lightness maximum value |
Type:
-
object
hslRgbMaximums
A set of maximum values for HSL and RGB.
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
hsl |
hslMaximums
|
<optional> |
{ h: 360, s: 100, l: 100 } | The HSL maximum values |
rgb |
rgbMaximums
|
<optional> |
{ r: 255, g: 255, b:255 } | The RGB maximum values |
Type:
-
object
rgb
A set of RGB values
Properties:
| Name | Type | Description |
|---|---|---|
r |
number
|
The Red value |
g |
number
|
The Green value |
b |
number
|
The Blue value |
Type:
-
object