color-name-lib
v1.1.0
Published
Search for names of colors close to that color.
Downloads
106
Maintainers
Readme
color-name-lib
Search for names of colors close to that color.
Teams
Usage
colorName(color, language)
color: hex (ex: '#FFFFFF'|'FFFFFF')|rgb (ex: [255, 255, 255]|{ r: 255, g: 255, b: 255 }) language?: string ('en'|'ja'|'cn', default: 'en')
const colorName = require('color-name-lib');
console.log(colorName('#FFFFFF')); // 'white'
console.log(colorName('#FFFFFF', 'en')); // 'white'
console.log(colorName('#FFFFFF', 'ja')); // '白'
console.log(colorName('#FFFFFF', 'cn')); // '白'