# color-delta

> calculate the diff between 2 colors

Latest version **0.3.3** (published 2015-05-27) · MIT license · 0 weekly downloads

## Install

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

Provides the command `color-delta`.

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.3 |
| Published | 2015-05-27 |
| First published | 2015-05-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Matias Singers |
| Maintainers | matiassingers |

## Links

- npm: https://www.npmjs.com/package/color-delta
- Repository: https://github.com/matiassingers/color-delta
- Issues: https://github.com/matiassingers/color-delta/issues
- npm.io page: https://npm.io/package/color-delta

## Dependencies (2)

- [tinycolor2](https://npm.io/package/tinycolor2.md) 1.1.2
- [lodash.mapvalues](https://npm.io/package/lodash.mapvalues.md) 3.0.1

## Recent versions

- 0.3.3 (latest) — 2015-05-27
- 0.3.2 — 2015-05-27
- 0.3.1 — 2015-05-27
- 0.3.0 — 2015-05-27
- 0.2.0 — 2015-05-27
- 0.1.0 — 2015-05-27

## README

# color-delta [![Build Status](http://img.shields.io/travis/matiassingers/color-delta.svg?style=flat-square)](https://travis-ci.org/matiassingers/color-delta) [![Dependency Status](http://img.shields.io/gemnasium/matiassingers/color-delta.svg?style=flat-square)](https://gemnasium.com/matiassingers/color-delta) [![Coverage Status](http://img.shields.io/coveralls/matiassingers/color-delta.svg?style=flat-square)](https://coveralls.io/r/matiassingers/color-delta)
> calculate the diff between 2 colors

Accepts almost all types of color strings, see [TinyColor](https://github.com/bgrins/TinyColor#accepted-string-input) for more info.

Partially extracted from [Sass Colour Function Calculator](http://razorjam.github.io/sasscolourfunctioncalculator/).


## Install

```sh
$ npm install --save color-delta
```


## Usage

```js
var colorDelta = require('color-delta');

colorDelta('#BADA55', '#B0BCA7', 2)
// => { hue: 19.84, saturation: ... }
```


## CLI

```sh
$ npm install --global color-delta
```

```sh
$ color-delta --help

  calculate the diff between 2 colors

  Example
    color-delta #bada55 #b0bca7
    => {
         "hue": 19.849624060150404,
         "saturation": 0.5070282063269438,
         "lightness": -0.10196078431372546
       }
```


## API

#### Base

Type: `String`  

Base color to calculate difference from.

#### Target

Type: `String`  

Target color to calculate difference to.

#### Decimals

Type: `String`  
*optional*  

Fixed number of decimals in returned values.


## Related
- [`sass-color-calculator`](https://github.com/matiassingers/sass-color-calculator)


## License

MIT © [Matias Singers](http://mts.io)

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