Giter Site home page Giter Site logo

dreadlord1984 / color-names Goto Github PK

View Code? Open in Web Editor NEW

This project forked from meodai/color-names

0.0 3.0 0.0 4.44 MB

Massive color dictionary ๐ŸŒˆ

Home Page: http://codepen.io/meodai/full/mEvZRx/

License: MIT License

JavaScript 94.74% Shell 4.33% Smarty 0.93%

color-names's Introduction

17530 color-names

GitHub release npm version npm Travis color count Buy Me a Coffee at ko-fi.com

A handpicked list of 17530 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 empathy. Kenya Hara โ€“ White

About ๐Ÿ“‹

The aim of this project is to create as large a list of color names as possible. 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.

Make sure to read the naming rules before you contribute!

color count: 17530 ๐ŸŽ‰

(~0.10% of all RGB Colors)

3d representation of color distribution in RGB Space (Preview image of link above) 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 too many colors snapping 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.

Usage ๐Ÿ“–

Installation Node.js ๐Ÿ“ฆ

npm install color-name-list --save

or yarn add color-name-list

CDN ๐ŸŒ JSON / CSV / YML / JS / XML / HTML / SCSS

API ๐Ÿƒ

https://api.color.pizza/v1/{{hexvalue without the #}},{{more comma separated values}}

Single Color

curl https://api.color.pizza/v1/212121

{
  "colors": [{
    "name": "Lead",
    "hex": "#212121",
    "rgb": {"r":33, "g":33, "b":33},
    "distance": 0, // its an exact match
    "luminance": 22.062320231562225,
    "requestedHex": "#212121",
  }]
}

Multiple Colors

curl https://api.color.pizza/v1/212121,060606,ff0012,550055,123456

All Named Colors

curl https://api.color.pizza/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 16777216 possible RGB colors, you might use a library such as nearest-color to help you find the the closest named color.

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

// nearestColor need objects {name => hex} as input
const colors = colorNameList.reduce((o, { name, hex }) => Object.assign(o, { [name]: hex }), {});

const nearest = nearestColor.from(colors);

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

Alternative package: ktree

Note: If you are looking for something visually more accurate, you could: use DeltaE, or use the above snippet, combined with a transform from rgb to ciecam02 scaled to 0-255.

Building ๐Ÿ”จ

npm install && npm run build

See package.json for more.

Sources ๐Ÿ—’

Sources: Names ๐Ÿ“‡

Sources: Color ๐ŸŽจ

Contributors ๐Ÿฆ‘

Disclaimer ๐Ÿ‘ฎ๐Ÿพโ€

In the process we try to remove all names that are offensive or racist, as well as protected brand names. As some of the color names come from other lists, some bad ones might slip in. Please report them, they will be removed as quickly as possible.

color-names's People

Contributors

meodai avatar caub avatar qwhex avatar diluno avatar

Watchers

James Cloos avatar DL avatar  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.