1.3.4 • Published 3 years ago

cherangi v1.3.4

Weekly downloads
9
License
MIT
Repository
github
Last release
3 years ago

Cherangi

npm version Known Vulnerabilities

A small javascript library that helps you find the name of a color (Over 29K 🎨 color names, Thanks to color-name-list package )..

cherangi

Meaning

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

Install

$ npm install cherangi --save

+ cherangi@VERSION

Usage

const cherangi = require("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 CodeStatus Description
0Exact Match
2Not perceptible by human eyes.
4Perceptible through close observation.
8Perceptible at a glance.
-1No 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 cherangi

+ 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.

1.3.4

3 years ago

1.3.3

3 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago