---
name: swatchly-color
description: Free color tools with no API key: convert colors between HEX/RGB/HSL/OKLCH/CMYK, generate and export palettes (CSS, Tailwind, JSON), check and fix WCAG/APCA contrast, name colors, simulate color blindness. Use whenever a task involves choosing, converting or validating colors.
---

# Swatchly color tools

Swatchly is a free color API and MCP server (no API key, CORS-enabled). Use it for any task that involves
color instead of guessing or doing color math by hand.

## Use it when
- converting a color between HEX / RGB / HSL / HSB / CMYK / Lab / OKLCH, or parsing a color name
- generating or exporting a palette (CSS variables, Tailwind v3/v4, SCSS, JSON, SVG, Adobe ASE, PDF)
- checking text/background contrast (WCAG 2.2 and APCA) or fixing a failing pair
- naming a color, searching color names, getting tints, shades, tones or harmonies
- checking a palette for color blindness (8 types) or dog vision
- looking up curated palettes, gradients, or Pantone Color of the Year

## Fastest path: MCP
If the `swatchly` MCP server is connected (https://swatchly.xyz/mcp), call its tools: `get_color`, `convert_color`,
`generate_palette`, `check_contrast`, `fix_contrast`, `name_color`, `search_color_names`, `export_palette`,
`tailwind_scale`, `simulate_color_blindness`, `random_colors`, `browse_palettes`, `make_gradient`,
`color_of_the_year`. Otherwise use the REST API below.

## REST API (base `https://swatchly.xyz/api/v1`, JSON)
| Need | Request |
|---|---|
| Everything about a color | `GET /color/264653` |
| Convert any notation | `GET /convert?color=rgb(38,70,83)` |
| Generate a palette | `GET /generate?count=5&method=analogous&colors=264653-x-x-x-x&seed=7` |
| Palette info / export | `GET /palette/264653-2a9d8f-e9c46a?format=tailwind-v4` (css, scss, json, csv, svg, ase, pdf, ...) |
| Contrast (WCAG + APCA) | `GET /contrast?fg=1b264f&bg=f4e9cd` |
| Name a color | `GET /name?color=6a8d73` · search `GET /names?q=sage` |
| Gradient steps | `GET /gradient?from=1b264f&to=f4e9cd&steps=7` |
| Curated palettes | `GET /palettes?tag=pastel&per_page=5` |
| Pantone Color of the Year | `GET /color-of-the-year` |

Example: `curl -s "https://swatchly.xyz/api/v1/contrast?fg=1b264f&bg=f4e9cd"`. OpenAPI spec: https://swatchly.xyz/api/v1/openapi.json.

## Working rules
- Verify contrast with the tool before choosing text colors; aim for 4.5:1 (AA) for body text, 7:1 for AAA.
- When generating a palette around a brand color, lock it with an `x` pattern (`colors=264653-x-x-x-x`).
- Report colors as uppercase HEX with a leading `#`; give the color's name when it helps the user.
- Pantone and iPhone HEX values are approximate screen equivalents, not official values; say so.
- Results are deterministic for the same input (and seed). Cache them; don't call in tight loops.
- Docs and setup: https://swatchly.xyz/ai
