looks-same
Advanced tools
Comparing version 2.1.0 to 2.2.0
# Changelog | ||
## 2.2.0 - 2015-09-11 | ||
* Expose color comparsion function `looksSame.colors` (@SevInf). | ||
## 2.1.0 - 2015-08-07 | ||
@@ -4,0 +8,0 @@ |
@@ -220,1 +220,10 @@ 'use strict'; | ||
} | ||
exports.colors = function(color1, color2, opts) { | ||
opts = opts || {}; | ||
if (opts.tolerance === undefined) { | ||
opts.tolerance = JND; | ||
} | ||
var comparator = makeCIEDE2000Comparator(opts.tolerance); | ||
return comparator(color1, color2); | ||
}; |
{ | ||
"name": "looks-same", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Pure node.js library for comparing PNG-images, taking into account human color perception.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -82,1 +82,13 @@ # LooksSame | ||
``` | ||
## Comparing colors | ||
If you just need to compare two colors you can use `colors` function: | ||
```javascript | ||
looksSame.colors( | ||
{R: 255, G: 0, B: 0}, | ||
{R: 254, G: 1, B: 1}, | ||
{tolerance: 2.5} | ||
); | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18040
335
94