GET /api/color/{code}
One colour by its EDEC code. Any unambiguous prefix of the full code works, exactly like the web address https://edera.pro/atlas/{code}. An ambiguous prefix answers 404 with the candidates.
The whole atlas as JSON. No key, no sign-up, Access-Control-Allow-Origin: *,
so it can be read from a browser, a plugin or a script. Give it an EDEC code and it gives
back the colour with every value the book prints.
https://edera.pro/atlas/api/color/32k00
{
"series": "edera-atlas",
"version": "2",
"api": "1",
"docs": "https://edera.pro/atlas/api",
"color": {
"code": "32K00",
"code_full": "32K0051KRW",
"hex": "#1A292D",
"rgb": [
26,
41,
45
],
"cmyk": [
42,
9,
0,
82
],
"hsl": [
193,
27,
14
],
"lab": [
15.5,
-5.2,
-4.8
],
"lch": [
15.5,
7.08,
222.71
],
"hue": 222.7,
"chroma": 7.1,
"sector": "H",
"band": "shadow",
"band_name": "Shadow",
"role": "further accent",
"role_name": "further accent",
"name": "black",
"coverage": 0.55,
"ink": "light",
"plate": {
"slug": "srl",
"code": "SRL",
"title": "Paseo a orillas del mar",
"title_en": "Strolling along the seashore",
"artist": "Joaquin Sorolla",
"year": "1909",
"url": "https://edera.pro/atlas/srl"
},
"url": "https://edera.pro/atlas/32k00",
"image": "https://edera.pro/atlas/og/32k00.png"
}
}
All of them answer GET and OPTIONS, always as application/json; charset=utf-8. Base: https://edera.pro/atlas/api
/api/color/{code}One colour by its EDEC code. Any unambiguous prefix of the full code works, exactly like the web address https://edera.pro/atlas/{code}. An ambiguous prefix answers 404 with the candidates.
/{code}.jsonThe same colour object, hanging off the printed address. Add .json to any colour URL.
/api/colors?codes=a,b,cUp to 100 colours in one call. Codes separated by commas, spaces or plus signs. Unknown codes come back in missing.
/api/nearest?hex=RRGGBB&n=12The closest catalogue colours to any sRGB hex, ranked by CIEDE2000. n between 1 and 50. Each colour carries delta and delta_label.
/api/search?q=textThe site search: an EDEC code, a plate slug, a title, a colour word or a hex. Returns plates and colours as the search page shows them.
/api/plate/{slug}One plate with its sixteen colours in full.
/api/platesEvery plate in the catalogue, without colours.
/api/catalogueEvery colour in the catalogue in short form: code, hex, name, band, sector, plate, url. Cached for a day.
What /api/color/{code}, /api/colors, /api/nearest and /api/plate/{slug} return for each colour.
| Field | Type | Meaning |
|---|---|---|
code | string | The EDEC code as printed, upper case. |
code_full | string | The long code the short one abbreviates. The short one is a prefix of it. |
hex | string | sRGB, #RRGGBB, upper case. |
rgb | int[3] | 0–255. |
cmyk | float[4] | Percentages, the ones printed in the book. |
hsl | float[3] | Hue 0–360, saturation and lightness 0–100. |
lab | float[3] | CIE L*a*b*, D65. |
lch | float[3] | Lightness, chroma, hue from Lab. |
hue | float | LCh hue, degrees. |
chroma | float | LCh chroma. |
sector | string | Hue sector A–L, thirty degrees each. |
band | string | One of shadow, half-shadow, midtone, light. |
band_name | string | The band label as shown on the site. |
role | string | The role the colour plays in its painting, when measured. |
name | string | The colour family word: red, ochre, olive, grey… |
coverage | float | Percentage of the painting this colour covers. |
ink | string | dark or light: which ink reads on top of this colour. |
plate | object | slug, code, title, title_en, artist, year, url of the plate it was measured on. |
url | string | The colour page, the address printed in the book. |
image | string | A 1200×630 PNG of the colour, for previews. |
Browser or Node:
const r = await fetch('https://edera.pro/atlas/api/color/32k00');
const { color } = await r.json();
console.log(color.hex, color.lab, color.plate.title);
Shell:
curl -s 'https://edera.pro/atlas/api/nearest?hex=1A292D&n=3' | jq '.colors[] | {code, hex, delta}'
Python:
import json, urllib.request
with urllib.request.urlopen('https://edera.pro/atlas/api/colors?codes=32k00') as r:
for c in json.load(r)['colors']:
print(c['code'], c['hex'], c['name'])
Errors are JSON too: {"error": "color_not_found"} with status 404,
ambiguous_code with the candidates, invalid_hex,
missing_codes or too_many_codes with status 400.
Responses are cacheable (an hour, the catalogue a day); please cache them on your side.
Files for design tools —ASE, ACO, GPL, SVG, CSS, JSON— hang off each plate:
https://edera.pro/atlas/srl.ase.
The colours are measured on paintings in the public domain and are free to use. A link back to the colour page is welcome. Version 2 of the catalogue, API v1.