Color Format Converter
Pricing
Pay per event
Color Format Converter
Convert colors between HEX, RGB, HSL, HSB/HSV, and CMYK in batch. Auto-detects input format and returns all conversions plus the nearest CSS named color. Ideal for designers, front-end developers, and design system tooling. Outputs structured JSON with all formats.
Pricing
Pay per event
Rating
0.0
(0)
Developer
Stas Persiianenko
Actor stats
0
Bookmarked
2
Total users
1
Monthly active users
3 days ago
Last modified
Categories
Share
Convert colors between HEX, RGB, HSL, HSB/HSV, and CMYK formats — bulk supported. Auto-detects input format. Returns every representation plus the nearest CSS color name.
What does it do?
Color Format Converter accepts a list of color values in any supported format, automatically detects the format, and converts each color to every other format simultaneously. You get:
- HEX —
#ff5733 - RGB —
rgb(255, 87, 51) - HSL —
hsl(11, 100%, 60%) - HSB / HSV —
hsb(11, 80%, 100%) - CMYK —
cmyk(0%, 66%, 80%, 0%) - Color Name — nearest CSS / human-readable name (e.g., "Orange Soda", "Azure", "Coral")
You can process a single color or thousands in one run. The actor outputs a clean dataset, one row per color, with every format in both string and object form.
Who is it for?
Designers and creative teams
You have a hex color from Figma and need the CMYK values for your print vendor. Or you have an HSL palette from your design system and need hex codes for the developer handoff. Color Format Converter handles all cross-format conversions instantly.
Front-end and web developers
CSS accepts HEX, RGB, and HSL — but not HSB or CMYK. If you receive colors from a design tool in HSB format, this actor converts them to CSS-ready values. Use it in your pre-build pipeline or via the API to keep color palettes in sync.
Data engineers and ETL pipelines
Scrapers and APIs return colors in inconsistent formats. Normalize them all to a single canonical format (e.g., hex) before loading into your database or passing to downstream services.
Print and production professionals
Print workflows typically require CMYK values. Digital assets (web, apps) come in HEX/RGB. Use this actor to batch-convert entire palettes from digital to print-ready format without manual calculation.
AI and ML teams
Training datasets, image annotation pipelines, and color analysis tools often need colors in a specific numerical format. Use this actor to preprocess and normalize color values at scale.
Why use it?
- No coding required — convert colors directly from the Apify UI or via API
- Auto-detects format — you don't need to tag which format each input is; the actor figures it out
- All formats in one pass — no need to run separate converters for HEX→RGB and RGB→HSL; one run gives you everything
- Nearest color name — get the closest human-readable name from a curated list of over 1,400 named colors
- Bulk processing — convert hundreds or thousands of colors in a single run
- Structured output — each field is available as both a formatted string and a parsed object (for direct use in code)
- Handles edge cases — invalid colors are flagged with an error message, not silently skipped
What data does it return?
Each color produces one dataset row with the following fields:
| Field | Type | Example | Description |
|---|---|---|---|
inputColor | string | #ff5733 | The original input string |
hex | string | #ff5733 | HEX representation |
rgb | string | rgb(255, 87, 51) | RGB string |
rgbObject | object | {r:255,g:87,b:51} | RGB as parsed numbers |
hsl | string | hsl(11, 100%, 60%) | HSL string |
hslObject | object | {h:11,s:100,l:60} | HSL as parsed numbers |
hsb | string | hsb(11, 80%, 100%) | HSB/HSV string |
hsbObject | object | {h:11,s:80,b:100} | HSB as parsed numbers |
cmyk | string | cmyk(0%, 66%, 80%, 0%) | CMYK string |
cmykObject | object | {c:0,m:66,y:80,k:0} | CMYK as parsed numbers |
colorName | string | Orange Soda | Nearest human-readable color name |
isValid | boolean | true | Whether the color was parsed successfully |
error | string | (only if invalid) | Error message for unrecognized inputs |
How much does it cost to convert colors in bulk?
Color Format Converter uses Apify's Pay-Per-Event pricing model — you only pay for what you process:
| Event | Price |
|---|---|
| Actor start (one-time per run) | $0.01 |
| Per color converted | $0.0005 |
Example costs:
- 100 colors → $0.01 + (100 × $0.0005) = $0.06
- 1,000 colors → $0.01 + (1,000 × $0.0005) = $0.51
- 10,000 colors → $0.01 + (10,000 × $0.0005) = $5.01
Apify's Free plan includes $5 of monthly credit — enough to convert roughly 9,900 colors at no cost.
The actor uses minimal compute (256 MB memory, pure Node.js — no browser) so infrastructure costs are negligible. The per-event pricing covers all processing.
How to use Color Format Converter
Step 1 — Open the actor
Go to https://apify.com/automation-lab/color-format-converter and click Try for free.
Step 2 — Add your colors
In the Colors to convert field, enter one color per line. The actor accepts:
- HEX:
#ff5733orff5733or#FFF(shorthand) - RGB:
rgb(255, 87, 51)orrgb(255,87,51) - HSL:
hsl(11, 100%, 60%) - HSB / HSV:
hsb(11, 80%, 100%)orhsv(11, 80%, 100%) - CMYK:
cmyk(0%, 66%, 80%, 0%)orcmyk(0, 66, 80, 0) - CSS named colors:
coral,navy,rebeccapurple
Step 3 — Run
Click Start and wait a few seconds. Results appear in the Dataset tab.
Step 4 — Export
Export your results as JSON, CSV, Excel, or XML using the dataset export tools. Or pull results via API (see below).
Input parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
colors | array of strings | Yes | — | List of color values to convert. Any supported format, auto-detected. |
Example input JSON:
{"colors": ["#ff5733","rgb(0, 128, 255)","hsl(120, 100%, 50%)","coral","cmyk(0%, 66%, 80%, 0%)","hsb(240, 100%, 100%)"]}
Output examples
Valid color (#ff5733):
{"inputColor": "#ff5733","hex": "#ff5733","rgb": "rgb(255, 87, 51)","rgbObject": { "r": 255, "g": 87, "b": 51 },"hsl": "hsl(11, 100%, 60%)","hslObject": { "h": 11, "s": 100, "l": 60 },"hsb": "hsb(11, 80%, 100%)","hsbObject": { "h": 11, "s": 80, "b": 100 },"cmyk": "cmyk(0%, 66%, 80%, 0%)","cmykObject": { "c": 0, "m": 66, "y": 80, "k": 0 },"colorName": "Orange Soda","isValid": true}
Named color (coral):
{"inputColor": "coral","hex": "#ff7f50","rgb": "rgb(255, 127, 80)","rgbObject": { "r": 255, "g": 127, "b": 80 },"hsl": "hsl(16, 100%, 66%)","hslObject": { "h": 16, "s": 100, "l": 66 },"hsb": "hsb(16, 69%, 100%)","hsbObject": { "h": 16, "s": 69, "b": 100 },"cmyk": "cmyk(0%, 50%, 69%, 0%)","cmykObject": { "c": 0, "m": 50, "y": 69, "k": 0 },"colorName": "Coral","isValid": true}
Invalid input (not-a-color):
{"inputColor": "not-a-color","hex": "","rgb": "","hsl": "","hsb": "","cmyk": "","colorName": "","isValid": false,"error": "Could not parse color: \"not-a-color\""}
Tips and best practices
Mixing formats in one run
You can send colors in different formats in the same list — HEX and HSL and named colors all together. The actor auto-detects each one independently.
Getting structured output for code
Use rgbObject, hslObject, hsbObject, and cmykObject fields when you need numeric values directly in code. The string versions like rgb(255, 87, 51) are for human-readable display.
CMYK values are 0–100
This actor returns CMYK as integer percentages (0–100), not decimal fractions (0.0–1.0). Most print tools expect this format.
Nearest color name matching
The colorName field returns the closest match from a curated list of 1,400+ named colors. It uses Euclidean distance in RGB space. For exact CSS named colors (like coral or navy), the match will be the same name. For custom colors, it returns the closest named equivalent.
Handling large batches
The actor runs in 256 MB memory and processes colors sequentially. For 10,000+ colors, allow 2–3 minutes for the run to complete. There is no hard limit on input size.
What counts as a valid input?
- Hex with or without
#:ff5733and#ff5733both work - 3-digit shorthand hex:
#fff,#abc - RGB with or without spaces:
rgb(255,87,51)andrgb(255, 87, 51)both work - HSB and HSV are treated as the same format
- CMYK values with or without
%signs - Any standard CSS color name (
rebeccapurple,dodgerblue, etc.)
Integrations
Figma design token pipelines
Export your design tokens from Figma as JSON, extract the color values (which are typically in HEX format), and run them through this actor to generate CMYK equivalents for your print team or HSL values for your CSS custom properties.
Webflow / Framer → print workflow
Copy HEX colors from your website or prototype, batch-convert to CMYK, and hand off to your print vendor without manual conversion.
Zapier / Make (Integromat) automation
Use the Apify integration in Zapier or Make to trigger a color conversion run whenever new brand assets are uploaded, and automatically update a Google Sheet with all color format equivalents.
CI/CD color validation
Add a build step that runs your design token colors through this actor to verify they all parse correctly and match expected HEX values. Catch typos in color definitions before they reach production.
Database normalization
If you're storing colors scraped from product pages (which come in all formats), use this actor to normalize everything to HEX before inserting into your database.
API usage
Node.js (TypeScript / JavaScript)
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });const run = await client.actor('automation-lab/color-format-converter').call({colors: ['#ff5733', 'rgb(0, 128, 255)', 'coral', 'hsl(120, 100%, 50%)']});const { items } = await client.dataset(run.defaultDatasetId).listItems();console.log(items);// [{ inputColor: '#ff5733', hex: '#ff5733', rgb: 'rgb(255, 87, 51)', ... }, ...]
Python
from apify_client import ApifyClientclient = ApifyClient(token='YOUR_API_TOKEN')run = client.actor('automation-lab/color-format-converter').call(run_input={'colors': ['#ff5733', 'rgb(0, 128, 255)', 'coral', 'hsl(120, 100%, 50%)']})items = client.dataset(run['defaultDatasetId']).list_items().itemsfor item in items:print(item['inputColor'], '->', item['hex'], '|', item['colorName'])
cURL
# Start a runcurl -X POST \"https://api.apify.com/v2/acts/automation-lab~color-format-converter/runs?token=YOUR_API_TOKEN" \-H "Content-Type: application/json" \-d '{"colors": ["#ff5733", "coral", "rgb(0,128,255)"]}'# Fetch results (replace DATASET_ID from the run response)curl "https://api.apify.com/v2/datasets/DATASET_ID/items?token=YOUR_API_TOKEN"
Use with Claude AI (MCP)
This actor is available as a tool in Claude AI through the Model Context Protocol (MCP). Add it to Claude Desktop, Cursor, Windsurf, or any MCP-compatible client.
Setup for Claude Code
$claude mcp add --transport http apify "https://mcp.apify.com"
Setup for Claude Desktop, Cursor, or VS Code
Add this to your MCP config file:
{"mcpServers": {"apify": {"url": "https://mcp.apify.com"}}}
Example prompts
- "Convert these hex colors from my design file to CMYK for the print vendor: #1a2b3c, #ff5733, #4a90e2."
- "I have a list of colors in mixed formats — normalize them all to hex: hsl(120, 100%, 50%), coral, cmyk(0%, 40%, 80%, 0%)."
- "What is the nearest named color to #6b4c7a and what are its RGB and HSL values?"
Learn more in the Apify MCP documentation.
Supported formats (full reference)
| Format | Example inputs | Notes |
|---|---|---|
| HEX | #ff5733, ff5733, #FFF, #AABBCC | With or without #, 3 or 6 digits, any case |
| RGB | rgb(255, 87, 51), rgb(255,87,51) | Values 0–255 |
| HSL | hsl(11, 100%, 60%) | H: 0–360, S/L: 0–100% |
| HSB / HSV | hsb(11, 80%, 100%), hsv(11, 80%, 100%) | H: 0–360, S/B: 0–100% |
| CMYK | cmyk(0%, 66%, 80%, 0%), cmyk(0, 66, 80, 0) | Values 0–100, % optional |
| CSS named | coral, navy, rebeccapurple | All standard CSS4 color names |
Legality and terms of use
This actor performs pure mathematical color space conversions using open-source formulas. It does not scrape any website, access any external API, or process any personal data. Usage is subject to Apify's Terms of Service. There are no legal restrictions on using this actor for any legitimate purpose.
FAQ
Q: What's the difference between HSB and HSV?
HSB (Hue, Saturation, Brightness) and HSV (Hue, Saturation, Value) are the same color model with different naming conventions. The "B" in HSB and the "V" in HSV both refer to the same axis — maximum brightness/value. This actor accepts both hsb(...) and hsv(...) syntax and treats them identically.
Q: My CMYK color looks wrong after conversion.
CMYK conversions go through RGB as an intermediate step because there is no direct mathematical relationship between CMYK and other digital color models — CMYK is device-dependent (it depends on the ink profile of your specific printer). The conversion this actor performs is the standard mathematical approximation used by most software tools. For precise print production, use your printer's ICC color profiles in a professional tool like Adobe Illustrator.
Q: Why does my CSS navy convert to "Royal" instead of "Navy"?
The colorName field returns the nearest name from a curated list of 1,400+ descriptive color names (not just the 140 basic CSS names). navy (#000080) is closest to "Royal" in that extended list. The hex field will still correctly show #000080 — only the name uses the extended list.
Q: Can I convert a color with alpha transparency?
Not currently. Alpha channels (rgba, hsla, hex with alpha like #ff573380) are not supported in v0.1. The actor will attempt to parse them but may strip the alpha channel or return an error. Alpha support is planned for a future version.
Q: What happens if I pass an empty string or whitespace?
The actor will flag it as invalid and include an error message in the error field. The run will continue processing the remaining colors — invalid inputs do not stop the batch.
Q: How accurate are the color name matches?
Color name matching uses Euclidean distance in RGB space across 1,400+ named colors. For common colors (red, blue, green, white, black), the match is exact. For uncommon or very custom colors, it returns the closest named neighbor. The accuracy is sufficient for labeling and human-readability purposes, not for strict palette matching.
Q: The actor is showing "Under maintenance" in the Store.
This typically means the default input (prefilled values) failed Apify's daily automated health check. Try running with the default prefilled input first. If that fails, check the run logs for errors. If the issue persists, contact support or open an issue on the actor page.
Related actors
Looking for more data transformation and conversion tools?
- Text Case Converter — Convert text between camelCase, snake_case, kebab-case, UPPER, lower, and Title Case
- Broken Link Checker — Scan any website for broken links and generate reports
- Canonical URL Checker — Verify canonical tags across your website pages
Built by automation-lab — your utility toolkit on the Apify Store.