Skip to content

npm package for library `name that color` created by Chirag Mehta

Notifications You must be signed in to change notification settings

yatiac/name-that-color

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

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
}

About

npm package for library `name that color` created by Chirag Mehta

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published