Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/levg34/hexcolor-namer
Get the human name of hexadecimal colors
https://github.com/levg34/hexcolor-namer
hexadecimal-color human-readable humanreadable
Last synced: about 7 hours ago
JSON representation
Get the human name of hexadecimal colors
- Host: GitHub
- URL: https://github.com/levg34/hexcolor-namer
- Owner: levg34
- License: gpl-3.0
- Created: 2024-07-09T13:41:58.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-07-10T10:40:17.000Z (4 months ago)
- Last Synced: 2024-10-31T18:31:57.058Z (19 days ago)
- Topics: hexadecimal-color, human-readable, humanreadable
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/hexcolor-namer
- Size: 82 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HexColorNamer
[![npm version](https://badge.fury.io/js/hexcolor-namer.svg)](https://www.npmjs.com/package/hexcolor-namer)
[![Build Status](https://travis-ci.com/levg34/hexcolor-namer.svg?branch=main)](https://travis-ci.com/levg34/hexcolor-namer)
[![License](https://img.shields.io/npm/l/hexcolor-namer)](https://github.com/levg34/hexcolor-namer/blob/main/LICENSE)HexColorNamer is an npm library that provides human-readable names for hexadecimal colors. It's inspired by Chirag Mehta's [Name that Color](https://chir.ag/projects/ntc/) 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:
```bash
npm install hexcolor-namer
```I am using Bun to develop this library, but of course you can use any package manager you like.
```bash
bun add hexcolor-namer
```## Usage
```javascript
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](https://chir.ag/projects/ntc/) 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](LICENSE) file for details.