CSS Named Colors
All 148 CSS `<named-color>` keywords, from aliceblue to yellowgreen, including the synonyms like cyan/aqua and grey/gray. Each entry gives the canonical lowercase name, the hex value, and the RGB triplet.
Quick fetch
Stable URL. CORS-enabled. No auth.
curl https://staticdata.dev/v1/css-named-colors.json
Or use as a typed import:
import { cssNamedColors } from "https://staticdata.dev/v1/css-named-colors.ts"
Formats
- JSON 15.3 KB
/v1/css-named-colors.json
min: 8.1 KB · /v1/css-named-colors.min.json
- CSV 4.3 KB
/v1/css-named-colors.csv
- TypeScript 15.5 KB
/v1/css-named-colors.ts
export const cssNamedColors
type CssNamedColor = (typeof cssNamedColors)[number]
Schema
Each record in the dataset has the following shape.
| Field | Type | Description | Example |
|---|---|---|---|
| name | string | Lowercase CSS color keyword | rebeccapurple |
| hex | string | Hex color value | #663399 |
| rgb | number[] | [red, green, blue], each 0–255 | [102,51,153] |
Preview
First 10 records.
Fetch examples
Drop-in snippets in five languages.
curl -sSL https://staticdata.dev/v1/css-named-colors.json | jq '.[0]' import type { CssNamedColor } from "https://staticdata.dev/v1/css-named-colors.ts";
const res = await fetch("https://staticdata.dev/v1/css-named-colors.min.json");
if (!res.ok) throw new Error(`Fetch failed: ${res.status}`);
const cssNamedColors: CssNamedColor[] = await res.json();
console.log(cssNamedColors[0]); import urllib.request, json
with urllib.request.urlopen("https://staticdata.dev/v1/css-named-colors.min.json") as r:
cssNamedColors = json.load(r)
print(cssNamedColors[0]) package main
import (
"encoding/json"
"fmt"
"net/http"
)
func main() {
resp, err := http.Get("https://staticdata.dev/v1/css-named-colors.min.json")
if err != nil { panic(err) }
defer resp.Body.Close()
var data []map[string]any
if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
panic(err)
}
fmt.Println(data[0])
} use serde_json::Value;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let body = ureq::get("https://staticdata.dev/v1/css-named-colors.min.json").call()?.into_string()?;
let data: Vec<Value> = serde_json::from_str(&body)?;
println!("{:?}", data.first());
Ok(())
} Sources and methodology
These are the named color keywords defined by CSS Color Module Level 4. The list originates in the X11 color names, was standardized through SVG and CSS, and is stable — rebeccapurple (added in CSS Color 4) is the most recent addition.
The hex values are canonical and the rgb triplets are derived from them. Several names are exact synonyms that resolve to the same value: aqua/cyan, fuchsia/magenta, and the gray/grey spelling pairs (including darkgray/darkgrey, slategray/slategrey, and so on). All names are kept so a lookup by either spelling succeeds. CSS color keywords are case-insensitive; they are stored lowercase here. The special keywords transparent and currentcolor and the CSS system colors (Canvas, ButtonText, …) are not <named-color> values and are not included.
Versioning
URLs under /v1/ are stable: field names and types will not change in a way
that breaks consumers. Values can be corrected or records added when the upstream source
changes; schema-incompatible updates ship under a new version path. See the
css-named-colors changelog for this dataset's history.
Related datasets
More Code datasets
- ansi-colors
- ascii
- cron-presets
- css-at-rules
- css-functions
- css-properties
- css-pseudo-classes
- css-pseudo-elements
- css-units
- data-units
- exit-codes
- file-signatures
- hash-algorithms
- js-array-methods
- js-math-methods
- js-object-methods
- js-string-methods
- json-schema-keywords
- jwt-claims
- mathematical-constants
- measurement-units
- node-builtin-modules
- owasp-top-10
- periodic-table
- physical-constants
- posix-signals
- programming-languages
- regex-flags
- regex-patterns
- roman-numerals
- si-base-units
- si-derived-units
- si-prefixes
- spdx-licenses
- strftime-tokens
- time-units
- unicode-blocks
- unicode-general-categories
- unicode-planes
- unix-file-permissions
- xterm-256-colors