# Color Converter API

> Color Converter translates color values across hex, RGB, CMYK, and named inputs into standard RGB formats and channel breakdowns. Paid plans expand output to include CMYK, HSL, ANSI 16-color codes, and recognized English color names.

**Endpoint:** `GET https://api.apiverve.com/v1/colorconverter`  
**Category:** Data Conversion  
**Cost:** 1 credit per call  
**Canonical page:** https://apiverve.com/marketplace/colorconverter

## Overview

Color Converter works by analyzing the color provided and converting it to the specified format. It uses advanced algorithms to convert the color to the specified format and returns the color in the new format.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl "https://api.apiverve.com/v1/colorconverter?hex=FF0000" \
  -H "x-api-key: YOUR_API_KEY"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `hex` | string | Yes | The color in hexadecimal format (e.g., FF0000). A leading # or 0x is accepted, and 8-digit hex with alpha (FF000080) returns the alpha separately |

## Response fields

- `hex` — string · Color in hexadecimal format with hash prefix included
- `rgb` — string · Color in red green blue comma-separated format
- `hsl` — string · Color in hue saturation lightness comma-separated format · (premium)
- `cmyk` — string · Color in cyan magenta yellow key comma-separated format · (premium)
- `ansi16` — number · ANSI 16-color code representation of the color · (premium)
- `name` — string · Common English name of the color if available · (premium)
- `channels` — object
  - `channels.rgbChannels` — number · Number of RGB color channels always three
  - `channels.cmykChannels` — number · Number of CMYK color channels always four
  - `channels.ansiChannels` — number · Number of ANSI color channels always one
  - `channels.hexChannels` — number · Number of hexadecimal color channels always one
  - `channels.hslChannels` — number · Number of HSL color channels always three

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "hex": "#FF0000",
    "rgb": "255, 0, 0",
    "hsl": "0, 100, 50",
    "cmyk": "0, 100, 100, 0",
    "ansi16": 91,
    "name": "red",
    "channels": {
      "rgbChannels": 3,
      "cmykChannels": 4,
      "ansiChannels": 1,
      "hexChannels": 1,
      "hslChannels": 3
    }
  }
}
```

## Use cases

- **Design System Tokens** — Frontend engineers convert designer-provided hex codes into RGB format to populate dynamic CSS variables across multi-theme web applications.
- **Print Production Prepress** — Before sending digital graphics to commercial printers, prepress technicians convert RGB values into four-channel CMYK codes for accurate plate alignment.
- **Terminal Interface Styling** — CLI developers map web color codes directly to ANSI 16-color numbers to colorize script output inside server terminal consoles.
- **Contrast Ratio Auditing** — When evaluating accessibility compliance, automated testing suites convert color names into RGB numbers to calculate exact background and foreground luminance.

## SDKs

- **npm** — `npm install @apiverve/colorconverter` (https://www.npmjs.com/package/@apiverve/colorconverter)
- **PyPI** — `pip install apiverve-colorconverter` (https://pypi.org/project/apiverve-colorconverter/)
- **NuGet** — `dotnet add package APIVerve.API.ColorConverter` (https://www.nuget.org/packages/APIVerve.API.ColorConverter)
- **Source** — https://github.com/apiverve/colorconverter-api

## More

- Full reference: https://docs.apiverve.com/ref/colorconverter
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
