Methods
RGBAToHexColormap(colormap) → {Array.<number>}
Convert RGBA color map to Hex color map the hex color is stored as a single integer
Parameters:
| Name | Type | Description |
|---|---|---|
colormap |
Array.<Array.<number>> |
- Source:
Returns:
- Type
- Array.<number>
hexColormapToRGBA(colormap) → {Array.<Array.<number>>}
Convert Hex color map to RGBA color map,
if the alpha channel is missing,
it will set to 255 (fully opaque)
Parameters:
| Name | Type | Description |
|---|---|---|
colormap |
Array.<string> |
- Source:
Returns:
- Type
- Array.<Array.<number>>
isNumberMatrix(matrix)
Check if the input is a number matrix
Parameters:
| Name | Type | Description |
|---|---|---|
matrix |
any |
- Source:
Returns:
isStringArray(array)
Check if the input is a string array
Parameters:
| Name | Type | Description |
|---|---|---|
array |
any |
- Source:
Returns:
normalizeColorMap(colormap) → {Array.<Array.<number>>}
if a colormap has only RGB values,
it will add the alpha channel to 255
Parameters:
| Name | Type | Description |
|---|---|---|
colormap |
Array.<Array.<number>> |
- Source:
Returns:
- Type
- Array.<Array.<number>>
normalizeHexColormap(colormap) → {Array.<string>}
if a Hex colormap string[] has only RGB values this function adds the alpha channel to FF
Parameters:
| Name | Type | Description |
|---|---|---|
colormap |
Array.<string> |
- Source:
Returns:
- Type
- Array.<string>
stringHexColormapToInt(colormap) → {Array.<number>}
convert a colormap from a string array to an integer array
Parameters:
| Name | Type | Description |
|---|---|---|
colormap |
Array.<string> |
- Source:
Returns:
- Type
- Array.<number>