---
title: "Get color names for specific hex values"
method: GET
path: "/v1/"
---

# Get color names for specific hex values

`GET /v1/`

Returns an array of colors from the specified list, with distance calculations 
to show how close each match is to the requested colors. When providing multiple 
values, the endpoint will find the closest match for each color.

If no colors are provided, returns all colors from the specified list.

When the server has socket.io enabled, this endpoint will also emit a 'colors' event
with the same response data to all connected socket clients.

## Response `200`

OK

- object
  - `colors` Color[]
    - `name` string, required — Name of the closest color relative to the hex value provided
    - `hex` string, required — Hex value of the color (can differ from the requested hex value)
    - `rgb` object, required — RGB values
      - `r` integer, required
      - `g` integer, required
      - `b` integer, required
    - `hsl` object, required — HSL values. All percentages are represented as integers (e.g., 50% as `50`).
      - `h` number, required
      - `s` number, required
      - `l` number, required
    - `lab` object, required — LAB values
      - `l` number, required
      - `a` number, required
      - `b` number, required
    - `luminance` number, required — Luminance value
    - `luminanceWCAG` number, required — Luminance value according to WCAG
    - `bestContrast` 'black' | 'white' — The best contrasting color ('black' or 'white') for text on this color
    - `swatchImg` object, required — SVG representation of the color
      - `svgNamed` string, uri, required — URL to SVG representation of the color with the name
      - `svg` string, uri, required — URL to SVG representation of the color without the name
    - `requestedHex` string, required — The hex value that was requested by the user
    - `distance` number, required — The distance between the requested hex value and the closest color (0 = exact match)
  - `paletteTitle` string — A creatively generated name for the color palette when multiple colors are requested

## Other responses

- `400` — BAD REQUEST
- `404` — NOT FOUND
- `409` — CONFLICT - Requested more unique colors than available

---

[API](https://skmtc.dev/color/apis/color-name-api.md) · [All operations](https://skmtc.dev/color/apis/color-name-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/color/color-name-api/revisions/98f9f0ba5658/schema)
