0.1.3 • Published 1 year ago

hexcolor-namer v0.1.3

Weekly downloads
-
License
GPL-3.0-only
Repository
github
Last release
1 year ago

HexColorNamer

npm version Build Status License

HexColorNamer is an npm library that provides human-readable names for hexadecimal colors. It's inspired by Chirag Mehta's Name that Color project and extends its functionality to publish it as an npm library, and support additional languages, including French.

Features

  • Convert hexadecimal color codes (e.g., "#FF5733") to descriptive color names (e.g., "Cinnabar"), or the nearest known color.
  • Supports multiple languages, including English and will support French in the future.
  • Lightweight and easy to use.

Installation

Install HexColorNamer using npm, pnpm, bun, etc:

npm install hexcolor-namer

I am using Bun to develop this library, but of course you can use any package manager you like.

bun add hexcolor-namer

Usage

import { getColorName } from 'hexcolor-namer'

const colorCode = '#FF5733'
const { name: colorName, nearestMatching, exactMatch } = getColorName(colorCode)

console.log(`Color ${colorCode} is named "${colorName}"`)

Credits

HexColorNamer is inspired by Chirag Mehta's Name that Color project. Special thanks to Chirag for his work and permission to create this TypeScript version.

License

This project is licensed under the GNU v3 License - see the LICENSE file for details.

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago