{"library":"ntcjs","title":"Name That Color JS (NTCJS)","description":"NTCJS is a Node.js CommonJS-compatible wrapper for the original Name That Color JavaScript library by Chirag Mehta. It provides a straightforward utility to convert hexadecimal color codes (e.g., `#6195ED`) into human-readable color names, along with the closest matching RGB value and an exact match boolean. The current stable version, 1.1.3 (or 1.1.4 for `@trihargianto/ntcjs`), has not been updated in several years, indicating a maintenance or effectively abandoned status. It primarily targets CommonJS environments, but ships TypeScript types for enhanced developer experience. Its key differentiator is its simplicity and direct port of the well-known 'Name That Color' algorithm, without additional features like i18n or advanced color manipulation found in other libraries.","language":"javascript","status":"maintenance","last_verified":"Thu Apr 23","install":{"commands":["npm install ntcjs"],"cli":null},"imports":["const ntc = require('ntcjs');","ntc.name('#6195ED');","import type { NTCResult } from 'ntcjs';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { readFileSync } from 'node:fs';\nimport ntc from 'ntcjs'; // In a real ESM setup, this might require a bundler or Node.js --experimental-json-modules\n\n// Example of usage from the README\nconst hexColor = '#6195ED';\nconst n_match = ntc.name(hexColor);\n\nconst n_rgb = n_match[0]; // RGB value of closest match\nconst n_name = n_match[1]; // Text string: Color name\nconst n_exactmatch = n_match[2]; // True if exact color match\n\nconsole.log(`Input Hex: ${hexColor}`);\nconsole.log(`Closest RGB: ${n_rgb}`);\nconsole.log(`Color Name: ${n_name}`);\nconsole.log(`Exact Match: ${n_exactmatch}`);\n\n// Demonstrating with another color\nconst anotherHex = '#FF0000';\nconst another_match = ntc.name(anotherHex);\nconsole.log(`\\nInput Hex: ${anotherHex}`);\nconsole.log(`Closest RGB: ${another_match[0]}`);\nconsole.log(`Color Name: ${another_match[1]}`);\nconsole.log(`Exact Match: ${another_match[2]}`);\n\n// Demonstrating with a slightly off color\nconst offHex = '#FE0001';\nconst off_match = ntc.name(offHex);\nconsole.log(`\\nInput Hex: ${offHex}`);\nconsole.log(`Closest RGB: ${off_match[0]}`);\nconsole.log(`Color Name: ${off_match[1]}`);\nconsole.log(`Exact Match: ${off_match[2]}`);","lang":"typescript","description":"This quickstart demonstrates how to import and use the `ntcjs` library to get the name of a given hexadecimal color code. It shows the structured array output including the closest RGB value, the color name, and whether it was an exact match. It uses `import` syntax suitable for TypeScript.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}