npm package for library name that color
created by Chirag Mehta (http://chir.ag/projects/name-that-color). Credits go to him.
npm install @yatiac/name-that-color
Receives any hex color code
const ntc = require('@yatiac/name-that-color');
console.log(ntc('#9fa632'));
Result:
{
"exactMatch": false,
"colorName": "Sushi",
"closestColor": "87AB39"
}
const ntc = require('@yatiac/name-that-color');
console.log(ntc('#000000'));
Result:
{
"exactMatch": true,
"colorName": "Black",
"closestColor": "#000000"
}
const ntc = require('@yatiac/name-that-color');
console.log(ntc('#yatiac'));
Result:
{
"closestColor": "#000000",
"colorName": "Invalid Color: #9FA6S32",
"exactMatch": false
}