Triadic Colors API: Generate Triadic Color Schemes

Need a vibrant, balanced color palette? This guide covers the Triadic Colors API, which generates three-color schemes by selecting colors equally spaced (120 degrees apart) on the color wheel, creating visually striking and harmonious combinations.

What are Triadic Colors?

Triadic colors are three colors equally spaced on the color wheel, forming a triangle. Starting from any base color, the other two colors are found at 120-degree and 240-degree rotations:

  • Base color: Your starting color (0 degrees)
  • Second color: +120 degrees rotation
  • Third color: +240 degrees rotation

Example: Red, Yellow, Blue form a classic triadic scheme (primary colors).

When to Use Triadic Schemes

Triadic color schemes create vibrant, high-contrast palettes. They work well when you want:

  • Bold, energetic designs
  • Clear visual distinction between elements
  • Playful, creative aesthetics
  • Balance without being boring
Design Tip: Choose one color as dominant (60%), another as secondary (30%), and the third as accent (10%) to avoid visual chaos.

Using the Triadic Colors API

TinyFn provides an endpoint for generating triadic color schemes:

API Request
GET https://api.tinyfn.io/v1/color/triadic
Headers: X-API-Key: your-api-key
Response
{
  "base": {
    "hex": "#3498db",
    "hsl": { "h": 204, "s": 70, "l": 53 }
  },
  "triadic": [
    { "hex": "#3498db", "hsl": { "h": 204, "s": 70, "l": 53 }, "rotation": 0 },
    { "hex": "#db9834", "hsl": { "h": 324, "s": 70, "l": 53 }, "rotation": 120 },
    { "hex": "#98db34", "hsl": { "h": 84, "s": 70, "l": 53 }, "rotation": 240 }
  ]
}

Parameters

Parameter Type Description
color string Base color in HEX, RGB, or HSL format (required)
format string Output format: hex, rgb, hsl, all. Default: all

Code Examples

JavaScript / Node.js

const response = await fetch(
  'https://api.tinyfn.io/v1/color/triadic?' + new URLSearchParams({
    color: '#3498db'
  }),
  { headers: { 'X-API-Key': 'your-api-key' } }
);
const result = await response.json();

// Get all three colors
result.triadic.forEach((color, i) => {
  console.log(`Color ${i + 1}: ${color.hex}`);
});

Python

import requests

response = requests.get(
    'https://api.tinyfn.io/v1/color/triadic',
    params={'color': '#e74c3c'},
    headers={'X-API-Key': 'your-api-key'}
)
result = response.json()

for i, color in enumerate(result['triadic']):
    print(f"Color {i + 1}: {color['hex']} (rotation: {color['rotation']})")

cURL

curl "https://api.tinyfn.io/v1/color/triadic?color=%233498db" \
  -H "X-API-Key: your-api-key"

Common Use Cases

  • Brand Colors: Create vibrant brand palettes
  • Web Design: Define primary, secondary, and accent colors
  • Data Visualization: Distinguish three data series
  • Infographics: Create eye-catching information displays
  • Marketing Materials: Design attention-grabbing graphics

Best Practices

  1. Use the 60-30-10 rule: Balance color usage with one dominant color
  2. Adjust saturation: Desaturate some colors if the palette feels overwhelming
  3. Test accessibility: Ensure sufficient contrast for text
  4. Consider context: Triadic schemes can be too bold for some applications

Use via MCP

Your AI agent can call this tool directly via Model Context Protocol — no HTTP code needed. Add TinyFn to Claude Desktop, Cursor, or any MCP client:

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

See all color tools available via MCP in our Color MCP Tools for AI Agents guide.

Try the Triadic Colors API

Get your free API key and start generating triadic color schemes.

Get Free API Key

Ready to try TinyFn?

Get your free API key and start building in minutes.

Get Free API Key