colority.js —— (~1kb) library to extract colors from pictures.

369 阅读1分钟

travis dependencies devDependencies

extracting colors from pictures.

DEMO

Installation

$ yarn add colority

Usage

import colority from 'colority';

colority(imageURL, colors => {
    // do something here...
});

// or skip pixels

colority(imageURL, {
    skip: 1000,
}, colors => {
    // do something here...
});

APIs

  • colority(imageURL[, options], colors => {})
    • imageURL: picture url.
    • options.skip: skip pixels(Optional, default to 10).
    • colors: the extracted rgb colors(Sort by quantity).

License

Licensed under the MIT License