ForHosting KIT · Data & Files

Convert colors

A single brand color often needs to exist in five different formats before the day is out: HEX for the stylesheet, CMYK for the print vendor, LAB for a color-matching algorithm. The color converter API takes one color in any supported notation and returns it translated into the rest, so no one is eyeballing a swatch and guessing.

● StableFree · in your browser
Use it from WebAPIEmailApp soonTelegram soon

Runs in your browser. Free, unlimited — your data never leaves this page.

The problem it quietly solves

Design systems, print shops and web front-ends each grew up speaking a different color language, and the math to move between them is not intuitive — RGB to LAB in particular involves an intermediate XYZ transform and a reference white point that most developers have no reason to remember. Rather than hunting down that formula or copying it from a decade-old blog post, you send the color once and get every representation back, computed the same way every time.

What the request looks like

Provide a color in any one supported format — a HEX string like #1E90FF, an RGB triplet, an HSL value, a LAB set, or CMYK percentages for print — and the task runs asynchronously. A task_id comes back immediately, and moments later the full set of equivalent values arrives by signed webhook or a signed link that stays valid for 24 hours.

Why five formats, not two

HEX and RGB are the web's native vocabulary, but they fall short elsewhere: CMYK is what a commercial printer actually mixes onto paper and doesn't map one-to-one from RGB without loss, HSL is what designers reach for when adjusting a shade's lightness intuitively, and LAB exists precisely because it approximates human perceptual distance between colors, which RGB does not. Supporting all five means the same call serves a front-end developer, a print production team and a QA engineer comparing two colors for perceptual similarity.

Where it fits in a pipeline

Drop it into a design-token build step that generates print-ready assets alongside web ones, a brand-guideline generator that needs every format documented automatically, or an accessibility checker that first normalizes arbitrary user-submitted colors before further analysis. Because it's billed per successful conversion with no subscription surprises, it scales cleanly whether you're converting one brand palette or an entire icon set.

A brief note on precision

Converting into and out of LAB and CMYK is inherently lossy in places — not every RGB color has an exact CMYK equivalent a printer can reproduce, and that's a property of the color spaces themselves, not a shortcut in the math. What this endpoint guarantees is that the conversion formulas are applied correctly and consistently, every time, across every call.

Design system tooling

Generate HEX, RGB, HSL, LAB and CMYK values for every token in a design system automatically, instead of maintaining them by hand across formats.

Print production handoff

Convert a brand's web-native HEX palette into CMYK percentages before sending final files to a commercial printer.

Accessibility and contrast tools

Normalize arbitrary user-submitted colors into a consistent format before running contrast-ratio or perceptual-difference calculations.

Brand guideline documents

Auto-populate a style guide's color section with every notation a designer or developer might need, generated from a single source color.

Which color formats does the color converter API support?

HEX, RGB, HSL, LAB and CMYK — you send a color in any one of them and receive the others computed from it.

Is this color converter API free to use?

The tool above runs free in your browser. The API is paid — each call draws from your prepaid ForHosting KIT balance: top up from $10.00 (it never expires), pay each request's published price, and a call with no balance returns HTTP 402. No subscription, no tokens, and a failed task is never charged.

What's the price per conversion?

$0.002 per request, and you're only billed when the task actually completes successfully.

Why isn't RGB-to-CMYK always a perfect round trip?

CMYK and RGB describe different physical color spaces — one subtractive ink, one additive light — so some RGB colors have no exact printable CMYK equivalent; that's a property of color itself, not a limitation of this API.

How is the result delivered?

Asynchronously: you get a task_id right away, and results follow via a signed webhook or a signed link valid for 24 hours.

Can I convert many colors at once?

Each request handles one color conversion; for bulk palettes, call the endpoint per color as part of an automated batch process.

Does it use a specific reference white point for LAB?

Yes, LAB conversion uses a standard reference white so results are consistent and reproducible across every request.

What happens with an invalid HEX code or out-of-range value?

The task fails with a clear error after up to three retries, and a failed task is never charged.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/data/color-convert

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, and soon from our app, email and Telegram.

curl -X POST https://api.kit.forhosting.com/data/color-convert \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"items":["valor-1","valor-2"]}'
{
  "items": [
    "valor-1",
    "valor-2"
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "data.color_convert",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_mb25
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →