match-colors
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

match-colors

Install

yarn add match-colors

Example

// get avarage color
avarage('image.png').then(res => console.log(color));

// get match colors
matchColors('image.png').then(res => console.log(color));

image

API

  • imageSrc: string | HTMLImageElement

  • config: Config

avarage('image.png');

avarage(imageElement.ref, { format: 'HEX' });

matchColors(document.getElementById('image'), { count: 5 });

Config

format

default: 'RGB'

options: 'HEX' | 'RGB'

Config the format of colors that should be returned.

size

default: 5

Config the size of a sample to extract color.

group

default: 40

Config how many similar colors should be combined into one color.

Only applicable for matchColor

count

default: 5

Config the amount of colors that should be returned.

Only applicable for matchColor

Readme

Keywords

Package Sidebar

Install

npm i match-colors

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

226 kB

Total Files

12

Last publish

Collaborators

  • enivia