Skip to content

Commit

Permalink
Use delta E distance in tests, add mocha, fix memo
Browse files Browse the repository at this point in the history
  • Loading branch information
John Merchant committed Jul 6, 2019
1 parent 1201d45 commit 1fd76ce
Show file tree
Hide file tree
Showing 4 changed files with 1,684 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let cache = new WeakMap()
var namer = module.exports = function(color, options) {
options = options || {}

const cacheKey = JSON.stringify({color, options});
const cacheKey = {color, options}
if (cache.has(cacheKey)) {
return cache.get(cacheKey);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"license": "MIT",
"devDependencies": {
"browserify": "^4.2.1",
"mocha": "~1.13.0"
"mocha": "^6.1.4"
},
"dependencies": {
"chroma-js": "^1.3.4"
Expand Down
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ suite('namer', function () {
var names = namer('FF0001')
assert.equal(names.basic[0].hex, '#FF0000')
assert.equal(names.basic[0].name, 'red')
assert.equal(Math.floor(names.basic[0].distance*100), 25)
assert.equal(Math.floor(names.basic[0].distance*100), 13)
})


Expand Down
Loading

0 comments on commit 1fd76ce

Please sign in to comment.