Skip to content

cheminfo-js/matrix-to-color

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

matrix-to-color

NPM version build status David deps npm download

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 min and max at 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)

License

MIT

About

Create an image with pixel colors based on the values of a matrix

Resources

License

Stars

Watchers

Forks

Packages

No packages published