GithubHelp home page GithubHelp logo

levg34 / hexcolor-namer Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 84 KB

Get the human name of hexadecimal colors

Home Page: https://www.npmjs.com/package/hexcolor-namer

License: GNU General Public License v3.0

TypeScript 100.00%
hexadecimal-color human-readable humanreadable

hexcolor-namer's Introduction

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.

hexcolor-namer's People

Contributors

levg34 avatar

Stargazers

Chirag Mehta avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.