Color Utilities

Complement Color

Calculate complementary colors (opposite on the color wheel) for any hex, RGB, or HSL input. Access via MCP in Cursor, Windsurf, or other AI editors at GET /v1/color/complement. Returns the exact opposite hue while preserving saturation and lightness. Perfect for generating contrast pairs in design workflows.

API Endpoint

GET /v1/color/complement

Code Examples

curl "https://tinyfn.io/v1/color/complement" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/color/complement', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests

response = requests.get('https://tinyfn.io/v1/color/complement',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's color tools:

{
  "mcpServers": {
    "tinyfn-color": {
      "url": "https://tinyfn.io/mcp/color",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

What color formats does the complement color tool accept?

Accepts hex (#FF0000), RGB (255,0,0), and HSL (0,100%,50%) formats. Always returns the complementary color in the same format as the input.

How do I use complement color in MCP with Cursor or Claude Code?

Call the color/complement tool with your base color. The AI agent gets the exact complementary color instantly instead of guessing, ensuring accurate color theory calculations.

What's the difference between complementary and analogous colors?

Complementary colors sit 180° opposite on the color wheel (red/green), while analogous colors are adjacent (red/orange/yellow). This tool only calculates true complements.

Does complement color work with transparency or alpha channels?

No, the tool focuses on pure color relationships. Alpha/transparency values are ignored, and the complement is calculated based on the base RGB values only.

Can I get multiple complement variations like triadic or split-complementary?

This tool returns only the direct complement (180° opposite). For triadic (120° apart) or split-complementary schemes, you'd need separate color harmony tools.

Try Complement Color Now

Get your free API key and start using Complement Color in seconds.

Get Free API Key