Generates random colors in hex, RGB, or HSL formats via GET /v1/color/random. Perfect for AI agents building UIs, generating design mockups, or creating color palettes programmatically. Returns deterministic output based on optional seed parameter. Works seamlessly in MCP-enabled editors like Cursor and Windsurf for instant color generation during development.
curl "https://tinyfn.io/v1/color/random" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/color/random', {
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/random',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
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"
}
}
}
}
Call GET /v1/color/random with no parameters to get a hex color like #3A7BD4. Add ?format=hex explicitly if needed.
Yes, use ?seed=123 to generate the same color every time. Essential for consistent design systems and testing scenarios.
Supports RGB (rgb(58, 123, 212)), HSL (hsl(215, 66%, 53%)), and named colors. Use ?format=rgb or ?format=hsl parameters.
AI agents can generate colors on-demand for CSS, design tokens, or UI components without hallucinating invalid hex codes or color values.
Make multiple API calls or use ?count=5 parameter if supported. Each call with different seeds ensures unique color sets for palettes.
Get your free API key and start using Random Color in seconds.
Get Free API Key