@yatiac/name-that-color

1.1.0 • Public • Published

npm npm

ntc (name that color)

npm package for library name that color created by Chirag Mehta (http://chir.ag/projects/name-that-color). Credits go to him.

Install

npm install @yatiac/name-that-color

Usage

Receives any hex color code

Approximate color:

const ntc = require('@yatiac/name-that-color');

console.log(ntc('#9fa632'));

Result:

{ 
    "exactMatch": false, 
    "colorName": "Sushi", 
    "closestColor": "87AB39" 
}

With exact match:

const ntc = require('@yatiac/name-that-color');

console.log(ntc('#000000'));

Result:

{ 
    "exactMatch": true, 
    "colorName": "Black", 
    "closestColor": "#000000" 
}

Invalid color code:

const ntc = require('@yatiac/name-that-color');

console.log(ntc('#yatiac'));

Result:

{
  "closestColor": "#000000",
  "colorName": "Invalid Color: #9FA6S32",
  "exactMatch": false
}

Package Sidebar

Install

npm i @yatiac/name-that-color

Weekly Downloads

9

Version

1.1.0

License

MIT

Unpacked Size

52.1 kB

Total Files

4

Last publish

Collaborators

  • yatiac