New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

color-name-list

Package Overview
Dependencies
Maintainers
2
Versions
389
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

color-name-list

long list of color names

  • 3.4.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
18K
decreased by-26.02%
Maintainers
2
Weekly downloads
 
Created
Source

15930 color-names

GitHub release npm version npm Travis license color count

A handpicked list of 15930 unique color names from various sources and thousands of user submissions. Try it yourself or read the full list.

The names of color function like a thread attached to a frightfully slender needle, capable of stitching together our most delicate emotions and memories. When the needle hits the target, we feel either pleasure or emathy. Kenya Hara – White

About 📋

The aim of this project is to create as large a list as possible of color names. We've merged various lists, modified the names when there were duplicates with different hex values, and shifted the colors a bit when there were identical colors with different names.

Submit a color via form 🌈 / or twitter 🐦

Make sure to read the naming rules before you contribute.

color count: 15930 🎉

Color distribution 🛰

When coming up with new color names, it is vital to know what spots in a certain color-space are crowded and where there is still room for new colors. For example; Our API returns the closest RGB color to a given HEX value. To avoid that to many colors snap to the same name, we aim to distribute the colors evenly in the color space: Visualization PS: you can choose between different color spaces on the bottom right.

Sources 🗒

Usage 📖

Installation Node.js 📦

npm install color-name-list --save

or yarn add color-name-list

CDN 🌍 JSON, CSV, YML, JS

API (v1) 🃏

https://color-names.herokuapp.com/v1/{{hexvalue without the #}},{{more comma separated values}}
Single Color

curl https://color-names.herokuapp.com/v1/212121

{
  "status": "names for '212121' returned",
  "colors": {
    "#212121": {
      "name": "Lead",
      "hex": "#212121",
      "rgb": {
        "r": 33,
        "g": 33,
        "b": 33
      },
      "isExactMatch": true
   }
}
Multiple Colors

curl https://color-names.herokuapp.com/v1/212121,060606,ff0012,550055,123456

All Named Colors

curl https://color-names.herokuapp.com/v1/

In this case colors is not an object but an array of objects sorted by color-name

Usage JS ⌨

Exact Color
import namedColors from 'color-name-list';

let someColor = namedColors.find(color => color.hex === '#ffffff');
console.log(someColor.name); // => white

let someNamedColor = namedColors.find(color => color.name === 'Eigengrau')
console.log(someColor.hex); // => #16161d
Closest Named Color

Since there are 16581375 possible RGB colors, you might use a library to help you find the the closest named color.

import namedColors from 'color-name-list';
import nearestColor from 'nearest-color';

// create Object needed for
let colors = {};

namedColors.forEach(color => {
  colors[color.name] = color.hex
});

nearestColorName = nearestColor.from(colors);

// get closest named color
nearestColorName('#f1c1d1'); // => Fairy Tale

Note: In this example we are using nearest-color. it is not the most accurate method, but by far the quickest since it looks for the nearest RGB neighbor. If you are looking for something visually more accurate, you might use a library returning the color with the closest DeltaE based on the Lab color-space.

Building 🔨

npm install && npm run build

See package.json for more.

Contributors 🦑

Disclaimer 👮🏾‍

In the process we try 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.

Buy Me a Coffee at ko-fi.com

Keywords

FAQs

Package last updated on 25 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc