Tool to extract color schemes from images
npm install color-extractFetch prominent colors from images.
``sh`Extract color schemes via terminal.
If --clusters is not defined, the getProminentColors is used
$ npm install -g color-extract
$ color-extract --input '/path/to/some/file.png' --number 3 --clustersPrints ["#141CFC","#04FC7C","#FC2404"]
`js
// Use it via the module.
import { getKMeansColors, getProminentColors } from 'color-extract';
getKMeansColors('/path/to/some/file.png', 3) .then(colors => winston.info(colors.colors))
getProminentColors('/path/to/some/file.png', 3).then(colors => winston.info(colors.colors));
// Top = true: Will seperate the color on the top line of the image.
// This option is only available in getProminentColors, not in getKMeansColors.
getProminentColors('/path/to/some/file.png', 3, true).then((colors) => {
winston.info(colors.top);
winston.info(colors.colors);
});
``