# color-harmonizer

> A tool that, given a main color and an array of unique colors, returns a list of those colors ordered relatively to the main color.

Latest version **1.0.0** (published 2020-08-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install color-harmonizer
pnpm add color-harmonizer
yarn add color-harmonizer
bun add color-harmonizer
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-08-03 |
| First published | 2020-08-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 129 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Leonardo Salazar |
| Maintainers | lsalazarm99 |
| Keywords | color, harmonizer |

## Links

- npm: https://www.npmjs.com/package/color-harmonizer
- Repository: https://github.com/lsalazarm99/color-harmonizer
- Homepage: https://github.com/lsalazarm99/color-harmonizer#readme
- Issues: https://github.com/lsalazarm99/color-harmonizer/issues
- npm.io page: https://npm.io/package/color-harmonizer

## Dependencies (2)

- [delta-e](https://npm.io/package/delta-e.md) 0.0.8
- [color-convert](https://npm.io/package/color-convert.md) ^2.0.1

## Alternatives

- [postcss-color-hex-alpha](https://npm.io/package/postcss-color-hex-alpha.md) — 6.4M weekly downloads
- [randomcolor](https://npm.io/package/randomcolor.md) — 348.0K weekly downloads
- [bows](https://npm.io/package/bows.md) — 1.3K weekly downloads
- [ep_prefer_color_scheme](https://npm.io/package/ep_prefer_color_scheme.md) — 260 weekly downloads
- [coc-yank](https://npm.io/package/coc-yank.md) — 61 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2020-08-03

## README

# color-harmonizer

`color-harmonizer` is a tool that, given a main color and an array of unique colors, returns a list of those colors
 ordered relatively to the main color.
 
 ```js
const harmonizedColors = {
  mainColor: [88, 24, 69],
  additionalColors: [
    [255, 195, 0],
    [255, 87, 51],
    [199, 0, 57]
  ]
};
```

How to get array of unique colors from an image? Take a look at:
- [`main-colors-picker`](https://www.npmjs.com/package/main-colors-picker)
- [`image-to-colors`](https://www.npmjs.com/package/image-to-colors)
 
## Installation
Just run:
```bash
npm install color-harmonizer
```

## Usage

It is pretty straightforward:
```js
import ImageToColors from "iamge-to-colors"; // Using image-to-colors to get all the colors from an image
import MainColorsPicker from "main-colors-picker"; // Using main-colors-picker to get an array of unique main colors
import ColorHarmonizer from "color-harmonizer";

const image = document.getElementById('myImage');
const colors = ImageToColors.get(image);
const mainColors = MainColorsPicker.get(colors);

const harmonizedColors = ColorHarmonizer.get(mainColors);
```

## Parameters

By default, the first color in the array of colors is taken as the main color. You can specify another main color by
 indicating its index in the array.

```js
const harmonizedColors = ColorHarmonizer.get(colors, 2); // This will the color in the index 2 (position 3)
```

---
_Source: https://npm.io/package/color-harmonizer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
