dominant-color-converter
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

dominant-color-converter

Users can make their own color list. Dominant colors are extracted by their images. Compare those colors one by one from their own color list. The most nearest color is picked and applied on the backgroundColor.

Install

You usually do not have to install util yourself. If your code runs in Node.js, util is built in. If your code runs in the browser, bundlers like browserify or webpack also include the util module.

But if none of those apply, with npm do:

npm install dominant-color-converter

Usage

 import Converter from 'dominant-color-converter'
 const converter = new Converter(['#000000','#abcdef','#ffffff'])
 const convertedColor = converter.convert('https://example.com/photo.png')
 /* 
 convertedColor = {
    muted: '#abcdef',
    vibrant: '#000000',
    ...
 }
 */

Notes

This library was made using node-vibrant.

Package Sidebar

Install

npm i dominant-color-converter

Weekly Downloads

1

Version

1.1.1

License

ISC

Unpacked Size

11 kB

Total Files

12

Last publish

Collaborators

  • waterdeer