1.0.1 • Published 9 years ago
matrix-to-color v1.0.1
matrix-to-color
Create an image with pixel colors based on the values of a matrix
API
matrixToColor(matrix, options)
Returns a Uint8ClampedArray with the image data.
Options
Most options are passed directly to the chroma.js library. See chroma.js docs
- mode: color mode used for interpolation (default:
'lab') - colors: array of color steps. Must contain at least two colors (default:
['white', 'black']) - domain: array of value steps. Must be sorted in ascending order and contain at least two values. You can place the special values
minandmaxat the extremities to use the min/max value of the matrix (default:['min', 'max']) - classes: if > 0, only this number of colors will be used (default:
0)