Generator Utilities

Generate Color

Creates random colors in hex, RGB, or HSL formats through GET /v1/generate/color. Perfect for design workflows, testing, or when your AI agent needs color data for mockups. Generate single colors or batches, with deterministic output ensuring consistent results across sessions in Cursor and other MCP-enabled editors.

API Endpoint

GET /v1/generate/color

Code Examples

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

response = requests.get('https://tinyfn.io/v1/generate/color',
    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 generator tools:

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

Learn more about MCP setup →

FAQ

How do I generate multiple random colors at once?

Add a count parameter to the endpoint: GET /v1/generate/color?count=5 returns an array of 5 random colors.

What color formats does the generator support?

Returns colors in hex (#FF5733), RGB (rgb(255, 87, 51)), and HSL (hsl(14, 100%, 60%)) formats depending on the format parameter.

Can I generate colors within a specific range or palette?

Yes, use brightness, saturation, or hue constraints to control the color space. Add parameters like min_brightness=0.3 for darker colors.

How does this work with MCP agents for design tasks?

AI agents in Cursor or Windsurf can call this tool to generate color schemes for UI mockups, avoiding hallucinated hex codes that might not exist.

Are the generated colors truly random or deterministic?

Random by default, but adding a seed parameter makes results deterministic and reproducible across multiple API calls.

Try Generate Color Now

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

Get Free API Key