1.0.5 • Published 4 years ago

dominant-colors v1.0.5

Weekly downloads
11
License
ISC
Repository
gitlab
Last release
4 years ago

dominant-colors

General

Get dominant colors for images.

Author: marina.eremina@bitcomp.fi

Maintainer: marina.eremina@bitcomp.fi

Install

npm install dominant-colors

Usage

// import dominant-colors
const dominantColors = require('dominant-colors');

// imageUrl - path to the image
// maxColorNumber - number of dominant colors to display (up to 12 colors)
dominantColors.showColors(imageUrl, maxColorNumber)
  .then(colors => {
    // colors is an array of hsla color codes
    // for example: ['hsla(0, 0%, 0%, 1)', 'hsla(0, 0%, 100%, 1)'];
  })
  .catch(error => {
    // handle error
  });
1.0.5

4 years ago

1.0.3

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago