Package Exports
- ntcjs
- ntcjs/src/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ntcjs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Name That Color
A Node CommonJS compatible wrapper for the Name That Color library (ntc js) - http://chir.ag/projects/ntc/
Installation
npm install ntcjs --saveGetting Started
const ntc = require('ntcjs');
const n_match = ntc.name('#6195ED');
n_rgb = n_match[0]; // RGB value of closest match
n_name = n_match[1]; // Text string: Color name
n_exactmatch = n_match[2]; // True if exact color match
console.log(n_match); // [ '#6495ED', 'Cornflower Blue', false ]Live Demo
This is a live demo of the original ntcjs library
http://chir.ag/projects/name-that-color/#6195ED
Running the Tests
Make sure you install the necessary dev dependencies needed to run the tests:
npm installThen run the tests
npm testDisclaimer
All credit goes to Chirag Mehta for creating the original ntc.js library.