2026-04-12 · 5 min read · accessibility · wcag · design · color

Generating Accessible Color Palettes — WCAG 2.2 at the API Level

The accessibility gap\n\nWCAG 2.2 requires:\n\n- 4.5:1 contrast for normal text\n- 3:1 contrast for large text (18pt+ or 14pt bold+)\n- 3:1 contrast for UI components (button borders, focus states)\n\nMost brand guideline decks don't check this. The result: text that's unreadable for people with low vision, color-blindness, or in bright sunlight.\n\n## The fix at design time\n\n``bash\n# Check if your brand primary + white meets WCAG AA\ncurl 'https://api.lazy-mac.com/color-palette/api/v1/contrast?fg=%23ffffff&bg=%238b5cf6'\n# → { ratio: 4.51, aa_normal: true, aa_large: true, aaa_normal: false }\n`\n\n## Auto-generate accessible palettes\n\nGiven a base color, generate a 5-shade palette where every pair meets AA:\n\n`bash\ncurl 'https://api.lazy-mac.com/color-palette/api/v1/generate?base=%238b5cf6&count=5&contrast=4.5'\n# → ['#0f0420','#2a0a5c','#5e1fb3','#8b5cf6','#c4a4ff']\n`\n\n## Harmonies, tints, shades\n\nThe API supports:\n\n- Monochromatic\n- Analogous\n- Complementary\n- Split-complementary\n- Triadic\n- Tetradic\n\nAll with automatic AA-compliance filtering.\n\n## HEX / RGB / HSL / CMYK conversion\n\nOne endpoint handles all format conversions:\n\n`bash\ncurl 'https://api.lazy-mac.com/color-palette/api/v1/convert?color=%238b5cf6&to=hsl'\n# → { h: 258, s: 90, l: 66 }\n`\n\n## Free tier + Pro\n\nColor Palette API — 100/day free. Pro $9.99/mo unlimited.\n\nOr MCP integration:\n\n`bash\nnpx -y @lazymac/mcp\n> Generate an accessible purple palette for our dashboard that meets WCAG AA contrast\n> Check if #8b5cf6 on #0a0a0f meets AA for normal text\n``\n\n## Related\n\nThis API pairs well with Placeholder Image API for prototypes and Tech Stack Detector for competitor color research. All included in MCP Pro $29/mo.


📬 MCP Security Weekly

One email per week — new CVEs, scanner improvements, MCPWatch grade drops on popular servers. Free. Unsubscribe anytime.

Support the work: MCP Pro $29/mo · MCPWatch Pro Report $49 · more posts