deltae

0.0.4 • Public • Published

Get the Delta-E from two hex color values

http://en.wikipedia.org/wiki/Color_difference

Implements the formulas from: http://www.easyrgb.com/index.php?X=MATH

Installation

npm install deltae

Usage

//Require the package var color = require('deltae');

var colorA = "#007ace"; var colorB = "#017acf"

//Get the color difference color.delta(colorA,colorB,function(delta){ console.log(delta); });

//You can also onvert rgb to XYZ

color.xyz(colorA, function(XYZ){ var X = XYZ.X; var Y = XYZ.Y; var Z = XYZ.Z; console.log(X+" "+Y+" "+Z); })

//Or CIE-Lab

color.lab(colorA,function(LAB){ var L = LAB.L; var a = LAB.a; var b = LAB.b; console.log(L+" "+a+" "+b); });

Readme

Keywords

Package Sidebar

Install

npm i deltae

Weekly Downloads

2

Version

0.0.4

License

MIT

Last publish

Collaborators

  • romanoide