apyhub
DEVELOPER TOOLS

Convert Color Formats API

What it does

Color Converter takes a single color value and returns a structured JSON response for using that color across your product stack. Send a color in #rrggbb, rgb(), or hsl() format, and use the result to standardise design tokens, generate palette variants, or feed color data into UI tooling.

Use Color Converter when you need to normalise user-supplied colors or move between common CSS color models without writing your own parsing logic. It is useful in design systems, theme editors, brand asset pipelines, and front-end tools that need consistent color handling.

Because the endpoint accepts a single color value, it returns the color in multiple formats such as HEX, RGB, HSL, HSV, and CMYK, along with accessibility information and matching color palettes., it fits cleanly into validation steps, admin interfaces, and automation workflows where colors may arrive in mixed formats. The response includes color conversions, accessibility information, and generated color palettes that can be used directly in design and development workflows.

If your app stores colors, renders previews, or checks contrast for accessible UI choices, Color Converter gives you a predictable way to transform and reuse color values without handling format conversions yourself.

POST
Convert a color
http://localhost:8080/creightonnick0/color-converter
QUICKSTARTGUIDE

Quickstart

Convert a color by sending it as JSON in the color field.

curl -X POST "http://localhost:8080/creightonnick0/color-converter" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"color":"#3498db"}'

What you'll get back

Returns a JSON object containing the converted color in multiple formats, accessibility information, and generated color palettes.

{
  "input": "ffffff",
  "hex": "#ffffff",
  "rgb": {
    "r": 255,
    "g": 255,
    "b": 255
  },
  "rgb_string": "rgb(255, 255, 255)",
  "hsl": {
    "h": 0,
    "s": 0,
    "l": 100
  },
  "hsv": {
    "h": 0,
    "s": 0,
    "v": 100
  },
  "cmyk": {
    "c": 0,
    "m": 0,
    "y": 0,
    "k": 0
  },
  "luminance": 1,
  "readable_text_color": "black",
  "palette": {
    "complementary": "#ffffff",
    "analogous": [
      "#ffffff",
      "#ffffff",
      "#ffffff"
    ],
    "triadic": [
      "#ffffff",
      "#ffffff"
    ]
  }
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
A color as hex (#rrggbb), rgb(), or hsl()

About this endpoint

What it does

Converts a color into HEX, RGB, HSL, HSV, and CMYK formats. The response also includes accessibility details such as the recommended text color and generated color palettes.

Request Body

ParameterTypeMandatoryDescription
colorStringYesA color as hex (#rrggbb), rgb(), or hsl()

Response

Returns a JSON object containing the converted color in multiple formats, accessibility information, and generated color palettes.

FieldTypeDescription
inputStringThe original color value provided in the request.
hexStringColor in HEX format.
rgbObjectColor represented as RGB values (r, g, b).
rgb_stringStringColor formatted as an rgb() CSS string.
hslObjectColor represented as HSL values (h, s, l).
hsvObjectColor represented as HSV values (h, s, v).
cmykObjectColor represented as CMYK values (c, m, y, k).
luminanceNumberRelative luminance of the color.
readable_text_colorStringRecommended text color (black or white) for better readability.
paletteObjectGenerated complementary, analogous, and triadic color palette.

Body

Name
Type
Description
bodyREQUIRED
object
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.