color-delta
v0.3.3
Published
calculate the diff between 2 colors
Downloads
195
Readme
color-delta
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