Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coloripedia color data

Open dataset of 312 named colors — hex, RGB, HSL and CMYK values, color families, tags and curated relations. Available as JSON, CSV, an npm package, and a free HTTP API with no key and no rate limits.

Maintained as part of Coloripedia, a color encyclopedia.

npm license


Install

npm install coloripedia
const { colors, getColor, nearestColorName } = require('coloripedia');

colors.length;                    // 312
getColor('sage').hex;             // "#B2AC88"
nearestColorName('#B4AE8A');      // "Sage"

Zero dependencies. Ships TypeScript types.


Accessibility index

Every colour is also tested against WCAG 2.2 contrast thresholds, as a background carrying white or black text:

const { getAccessibility, textColorFor } = require('coloripedia');

getAccessibility('sage');
// { white: 2.3, whiteAA: false, black: 9.15, blackAA: true,
//   recommended: 'black', bestRatio: 9.15, bestLevel: 'AAA', … }

textColorFor('navy-blue');   // "white"

Across the 312 colours, white text fails AA on 69.9% of them. The full study, including methodology, is at coloripedia.com/research/named-colors-accessibility-index.


Or just take the files

curl -O https://coloripedia.com/api/v1/colors.json
curl -O https://coloripedia.com/api/v1/colors.csv
curl -O https://coloripedia.com/api/v1/accessibility.json
curl -O https://coloripedia.com/api/v1/accessibility.csv

They also live in data/ in this repository.

Python

No package needed — it's a JSON file:

import json, urllib.request

url = "https://coloripedia.com/api/v1/colors.json"
colors = json.load(urllib.request.urlopen(url))["colors"]

def nearest(hex_code):
    r, g, b = (int(hex_code.lstrip("#")[i:i+2], 16) for i in (0, 2, 4))
    def distance(c):
        rmean = (c["rgb"]["r"] + r) / 2
        dr, dg, db = c["rgb"]["r"] - r, c["rgb"]["g"] - g, c["rgb"]["b"] - b
        return ((2 + rmean / 256) * dr**2 + 4 * dg**2
                + (2 + (255 - rmean) / 256) * db**2)
    return min(colors, key=distance)

print(nearest("#B4AE8A")["name"])   # Sage

Or with pandas, straight from the CSV:

import pandas as pd

df = pd.read_csv("https://coloripedia.com/api/v1/colors.csv", comment="#")
df[df.family == "green"].head()

Or call the API

No key, no sign-up, no quota — every endpoint is a static file on a CDN. CORS is open, so you can call it straight from a browser.

curl https://coloripedia.com/api/v1/colors/sage.json
Endpoint Returns
/api/v1.json Discovery document
/api/v1/colors.json All 312 colors
/api/v1/colors/{slug}.json One color — e.g. sage
/api/v1/families.json All 10 families
/api/v1/families/{family}.json One family — e.g. green
/api/v1/colors.csv The whole dataset as CSV

Full docs: coloripedia.com/api


Record shape

{
  "name": "Sage",
  "slug": "sage",
  "family": "green",
  "hex": "#B2AC88",
  "rgb": { "r": 178, "g": 172, "b": 136 },
  "hsl": { "h": 51, "s": 21, "l": 62 },
  "cmyk": { "c": 0, "m": 3, "y": 24, "k": 30 },
  "temperature": "warm",
  "saturation": "muted",
  "lightness": "medium",
  "tags": ["muted", "earthy", "calming", "subtle", "natural"],
  "description": "Sage is a muted green-gray, reminiscent of the leaves of the sage plant…",
  "meaning": "In Western cultures, sage symbolizes wisdom and tranquility…",
  "complementary": ["ultramarine", "egyptian-blue", "royal-blue"],
  "analogous": ["alabaster", ""],
  "similar": [""],
  "url": "https://coloripedia.com/colors/sage/",
  "updatedAt": "2026-06-27"
}

complementary, analogous and similar hold slugs, so they resolve against the same dataset. Optional fields — cssName, pantone, ral, ralName, ncs — appear only where a documented equivalent exists.


API reference

Export Description
colors All 312 records, sorted by slug
families Every family slug in the dataset
getColor(slug) One color, or undefined
getColorsByFamily(family) Every color in a family
nearestColor(hex) Closest named color to any hex
nearestColorName(hex) As above, name only

nearestColor uses redmean distance — a cheap approximation of perceptual difference that beats plain RGB euclidean distance without needing a color-space conversion. It accepts #B2AC88, B2AC88 or #abc, and throws a TypeError on anything else.


Where the data comes from

A colour earns an entry when its name appears in at least one of these documented sources:

Source Covers
W3C CSS Color specification the named colours in CSS
X11 colour names SVG and legacy HTML names
Pantone published name list industry-standard commercial names
RAL Classic / RAL Design European industrial and paint standards
NCS (Natural Color System) Scandinavian standard
Munsell Book of Color the academic notation
Documented historical usage names with an attested written record

Hex values are cross-checked against at least two independent sources before publication. Where sources disagree — which is more common than you'd expect — the most widely cited value is used and the variant noted. HSL and CMYK are derived mathematically from RGB, not sourced separately, because print CMYK depends on ink, substrate and printer profile. Optional fields (cssName, pantone, ral, ralName, ncs) appear only where a documented equivalent exists, so their absence means "not established", not "none".

Names are never invented, and a name appearing in a single marketing context without broader adoption does not qualify.

The full sourcing and verification policy is at coloripedia.com/methodology.

Found a wrong value or a missing colour? Open an issue — corrections ship fast, and land here as a minor version so a moved value is never silent.


Licence

CC BY 4.0. Use it commercially, modify it, redistribute it. The only condition is attribution:

<a href="https://coloripedia.com">Color data by Coloripedia</a>

Hex, RGB, HSL and CMYK values are factual and not copyrightable. The licence covers the compilation, the written descriptions and the curated relations. Long-form editorial content on individual color pages is not part of this dataset.

About

Open dataset of 312 named colors — hex, RGB, HSL, CMYK, families, tags and relations. Free JSON + CSV API, no key required. CC BY 4.0.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages