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.
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)
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"
}
}
}
}
Add a count parameter to the endpoint: GET /v1/generate/color?count=5 returns an array of 5 random colors.
Returns colors in hex (#FF5733), RGB (rgb(255, 87, 51)), and HSL (hsl(14, 100%, 60%)) formats depending on the format parameter.
Yes, use brightness, saturation, or hue constraints to control the color space. Add parameters like min_brightness=0.3 for darker colors.
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.
Random by default, but adding a seed parameter makes results deterministic and reproducible across multiple API calls.
Get your free API key and start using Generate Color in seconds.
Get Free API Key