apyhub
DEVELOPER TOOLS

Convert HEX to RGB/HSL API

What it does

Color Converter turns a HEX color into RGB and HSL values in a single request. Send a hex query string value and get the original hex back alongside rgb and hsl objects.

Use it when your app stores colors in one format but your UI, charts, or CSS pipeline needs another. The RGB response includes r, g, and b integers, while the HSL response includes h, s, and l numbers, so you can map a design token directly into whatever rendering system you use.

This is useful for design tools, theme builders, and frontend utilities that need to normalize color values before displaying previews or generating palettes. Because the response is structured and small, it is easy to plug into validation, transformation, or formatting workflows.

If you need consistent color conversion without writing the math yourself, Color Converter gives you the converted values in a simple, developer-friendly shape.

GET
Convert a HEX color to its RGB and HSL equivalents
http://localhost:8080/dosvak/color-convert
QUICKSTARTGUIDE

Quickstart

Convert a hex color by passing the hex value as a query parameter.

curl -X GET "http://localhost:8080/dosvak/color-convert?hex=%23FF5733" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with optional hex, hsl, and rgb fields describing the converted color. hsl is an object with numeric h, l, and s values, and rgb is an object with integer r, g, and b values.

{
  "hex": "#FF5733",
  "hsl": {
    "h": 14,
    "l": 60,
    "s": 100
  },
  "rgb": {
    "r": 255,
    "g": 87,
    "b": 51
  }
}
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.

About this endpoint

What it does

Converts a HEX color provided as a query parameter into its RGB and HSL equivalents. The response returns the original hex value along with hsl and rgb objects.

Query Parameter(s)

AttributeTypeMandatoryDescription
hexStringYesThe HEX color value to convert.

Response

Returns a JSON object with hex as a string, hsl as an object containing h, s, and l numbers, and rgb as an object containing r, g, and b integers.

AttributeTypeMandatoryDescription
hexStringNoThe original HEX color value.
hslObjectNoThe HSL representation of the color.
hsl.hNumberNoHue value.
hsl.sNumberNoSaturation value.
hsl.lNumberNoLightness value.
rgbObjectNoThe RGB representation of the color.
rgb.rIntegerNoRed channel value.
rgb.gIntegerNoGreen channel value.
rgb.bIntegerNoBlue channel value.

Query parameters

Name
Type
Description
hexREQUIRED
string
▣ 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.