color-delta

0.3.3 • Public • Published

color-delta Build Status Dependency Status Coverage Status

calculate the diff between 2 colors

Accepts almost all types of color strings, see TinyColor for more info.

Partially extracted from Sass Colour Function Calculator.

Install

$ npm install --save color-delta

Usage

var colorDelta = require('color-delta');
 
colorDelta('#BADA55', '#B0BCA7', 2)
// => { hue: 19.84, saturation: ... }

CLI

$ npm install --global color-delta
$ 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

License

MIT © Matias Singers

Readme

Keywords

none

Package Sidebar

Install

npm i color-delta

Weekly Downloads

24

Version

0.3.3

License

MIT

Last publish

Collaborators

  • matiassingers