Constructor
new (require("ColorsExtractor"))(optionsopt)
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Optional data Properties
|
Methods
extract(data) → {Array.<Object>}
- Source:
Extract colors from data.
Parameters:
Name | Type | Description |
---|---|---|
data |
Array.<Number> | List of colors with an array of flat colors by chanels with 0 to 255 per chanel (red, green, blue, alpha) |
Returns:
{ hex, red, green, blue, area, saturation }
- Type
- Array.<Object>
process(data) → {Array.<Color>}
- Source:
Run extract process and get list of colors.
Parameters:
Name | Type | Description |
---|---|---|
data |
Array.<Number> | List of colors with an array of flat colors by chanels with 0 to 255 per chanel (red, green, blue, alpha) |
Returns:
- Type
- Array.<Color>
(inner) testFunction(label, val)
- Source:
Test if value is a function.
Parameters:
Name | Type | Description |
---|---|---|
label |
String | |
val |
function |
(inner) testNumber(label, val, min, max)
- Source:
Test if value is a number.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
label |
String | ||
val |
Number | ||
min |
Number |
0
|
|
max |
Number |
(inner) testUint(label, val, min, max)
- Source:
Test if value is an integer.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
label |
String | ||
val |
Number | ||
min |
Number |
0
|
|
max |
Number |