npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@distributed/cherangi

v1.1.15

Published

A small javascript library that helps you find the name of a color (Over 18K 🎨 color names).

Downloads

10

Readme

@distributed/cherangi

Fork from shariati/cherangi, using dependabot to automatically update the color-name-list package.

npm version

A small javascript library that helps you find the name of a color (Over 18K 🎨 color names).

cherangi

Meaning

Cherangi (Che Rangi?) is a Farsi (Persian) sentence which means "What color?"

Install

# Using npm
$ npm install @distributed/cherangi --save

# Using yarn
yarn add @distributed/cherangi

Usage

const cherangi = require("@distributed/cherangi");

cherangi("#cfcfcf");

About Returned Object

The returned value holds the color information and if consists of a status , name, hex, delta and a message

Status

Holds the status information of the results which could be one of the following

| Status Code | Status Description | | ----------- | -------------------------------------- | | 0 | Exact Match | | 2 | Not perceptible by human eyes. | | 4 | Perceptible through close observation. | | 8 | Perceptible at a glance. | | -1 | No Color match found |

Name

A <string> that represents the color name of the input value if no exact match has been found then the most similar color will be returned.

Hex

A <string> that returns the matched color / similar color code in hex

Delta (E 76)

Delta E is a metric for understanding how the human eye perceives color difference. The term delta comes from mathematics, meaning change in a variable or function. The suffix E references the German word Empfindung, which broadly means sensation.

Message

A <string> to show the description of the current result.

Returned Object (Sample)

Valid
{
 status: 8,
 name: 'Neon Green',
 hex: '#39ff14',
 delta: 2.8270216256677023,
 message: 'Perceptible at a glance'
}
Invalid Input

For now all invalid inputs are handled as black color. This will be changed with a proper staus code in near future

{
 status: 1,
 name: 'Black',
 hex: '#000000',
 delta: 0,
 message: 'Exact Match'
}

CLI


$ npm install --global @distributed/cherangi

+  @distributed/cherangi@VERSION
$ cherangi --help

  Usage
    cherangi 'hexcode'
    cherangi '#hexcode'

  Example
    cherangi 'fff'
    cherangi '#fcfcfc'

Thanks to

Disclaimer

Please note cherangi uses color-names for the list of colors and in the process of creating this list the author tries to remove all names that are offensive or racist, as well as protect brandnames. As some of the color names come from other lists, it might happen that some bad ones slip in. Please report them, they will be removed as quickly as possible.