Overview
Color Name Finder compares the input against a fixed list of 141 CSS named colors, the number reported in `total_named_colors`. The `hex` parameter accepts 3-, 6- or 8-digit hex with or without `#`; shorthand is expanded and an 8-digit value's alpha pair is ignored. The parsed channels come back as `input_rgb`.
For each named color the API computes the straight-line Euclidean distance between the two colors in RGB space, the square root of the summed squared channel differences. `distance` is that value rounded to two decimals, from 0 for an identical color up to about 441.67 for black against white. `similarity` rescales it to a percentage: 100 minus distance as a share of 441.67, also rounded to two decimals. The list is then sorted by distance, nearest first. `exact_match` is true only when the nearest distance is exactly 0.
`closest_color` is the top entry, with `name`, `hex` (six digits, no `#`) and `rgb`. `closest_matches` holds the top N entries, where N is the `closest` parameter, from 1 to 20 with a default of 1. The CSS list contains duplicate values, such as Aqua and Cyan or Fuchsia and Magenta, so two entries can tie at the same distance and appear side by side.
RGB distance is simple and predictable but does not model human perception evenly, so two colors that look close can sit further apart than two that look different. On the Free plan the `closest` parameter is ignored, and `distance`, `similarity` and the `closest_matches` array are removed.
Live Test Color Name Finder API →
Endpoint
One host, one path per API. The block below shows this call in four languages; every one of them is the same HTTP request. Making requests covers the timeouts, retries and parameter rules that apply to all of them. The SDKs wrap the same call in a typed client.
curl "https://api.apiverve.com/v1/colornamefinder?hex=FF5733&closest=3" \
-H "x-api-key: your_api_key_here"const res = await fetch('https://api.apiverve.com/v1/colornamefinder?hex=FF5733&closest=3', {
headers: { 'x-api-key': 'your_api_key_here' },
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const { data } = await res.json();
console.log(data);import requests
res = requests.get(
"https://api.apiverve.com/v1/colornamefinder?hex=FF5733&closest=3",
headers={"x-api-key": "your_api_key_here"},
timeout=15,
)
res.raise_for_status()
print(res.json()["data"])package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.apiverve.com/v1/colornamefinder?hex=FF5733&closest=3", nil)
req.Header.Set("x-api-key", "your_api_key_here")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(string(out))
}Replace your_api_key_here with the key from your dashboard. When the inputs arrive as a list rather than one at a time, batch requests run up to 200 of them through this same API in a single call.
Authentication
Send your key in the x-api-key header. That is the only auth step — there is no token exchange and no per-endpoint scope to configure. Authentication covers creating, rotating and revoking keys.
A 401 means the key is missing, invalid or expired. A 403 means the key is valid but not permitted here — blocked by a key restriction or an IP allow-list. Running out of credits is a 429.
Parameters
Sent in the query string. Premium parameters are accepted on every plan but only take effect on plans that include them.
| Parameter | Type | Description |
|---|---|---|
hexRequired | string | Hex color value (with or without # prefix) hexColor |
closestOptionalPremium | integer | Number of closest color matches to return default 1 · range 1–20 |
Response
Every API returns the same three top-level keys, so one response handler covers your whole integration: status, error and data. Only data changes shape. Response format covers the envelope, the other output formats and how premium fields are withheld.
{
"status": "ok",
"error": null,
"data": {
"input_hex": "#FF5733",
"input_rgb": {
"r": 255,
"g": 87,
"b": 51
},
"exact_match": false,
"closest_color": {
"name": "Tomato",
"hex": "FF6347",
"distance": 23.32,
"similarity": 94.72,
"rgb": {
"r": 255,
"g": 99,
"b": 71
}
},
"closest_matches": [
{
"name": "Tomato",
"hex": "FF6347",
"distance": 23.32,
"similarity": 94.72,
"rgb": {
"r": 255,
"g": 99,
"b": 71
}
},
{
"name": "Coral",
"hex": "FF7F50",
"distance": 49.41,
"similarity": 88.81,
"rgb": {
"r": 255,
"g": 127,
"b": 80
}
},
{
"name": "Chocolate",
"hex": "D2691E",
"distance": 52.82,
"similarity": 88.04,
"rgb": {
"r": 210,
"g": 105,
"b": 30
}
}
],
"total_named_colors": 141
}
}
Response fields
Paths are relative to data. Premium fields are absent rather than zeroed on plans that do not include them, so check for presence instead of comparing to 0.
| Field | Type | Example | Description |
|---|---|---|---|
input_hex | string | "#FF5733" | The hex color value provided as input |
input_rgb | object | {...} | RGB color values decomposed from input hex |
r | number | 255 | Red component value from input |
g | number | 87 | Green component value from input |
b | number | 51 | Blue component value from input |
exact_match | boolean | false | Whether the input matches a named color exactly |
closest_color | object | {...} | Best matching named color with distance metrics |
name | string | "Tomato" | Name of the closest matching color |
hex | string | "FF6347" | Hex code of the closest matching color |
distancePremium | number | 23.32 | Euclidean distance metric in RGB space |
similarityPremium | number | 94.72 | Similarity percentage of closest match |
rgb | object | {...} | RGB values of the closest matching color |
r | number | 255 | Red component of closest color |
g | number | 99 | Green component of closest color |
b | number | 71 | Blue component of closest color |
closest_matchesPremium | array[3] | Array of top matching colors with metrics | |
namePremium | string | "Tomato" | Name of matched color in results |
hexPremium | string | "FF6347" | Hex code of matched color result |
distancePremium | number | 23.32 | Color distance metric for match result |
similarityPremium | number | 94.72 | Similarity percentage for match result |
rgbPremium | object | {...} | RGB values of matched color result |
rPremium | number | 255 | Red component of result match |
gPremium | number | 99 | Green component of result match |
bPremium | number | 71 | Blue component of result match |
total_named_colors | number | 141 | Total count of available named colors |
Errors
Read the HTTP status first, then error for the specific reason. The body names the parameter that has to change. Error handling covers the full status list and which of them are worth retrying.
| Status | Meaning | What to do |
|---|---|---|
400 | Input was rejected | Read error; it names the parameter. |
401 | Key missing or invalid | Check the header name and the key value. |
403 | Key valid, but not permitted | A key restriction or IP allow-list; see key scoping. |
429 | Rate limited, or out of credits | Read error to tell them apart; see rate limits. |
Use cases
- Design Tools
- Identify and name colors in design applications and color pickers
- Accessibility
- Convert hex colors to named colors for better communication and documentation
- Web Development
- Find CSS color names for hex values to improve code readability
- Color Analysis
- Analyze and categorize colors in images and designs with standard color names
Other ways to use Color Name Finder
Set up Color Name Finder on APIVerve, or reach the same source a different way. Your APIVerve account and credits work on all of them — one key, one balance.
Related
More in Reference Data: