Generates smooth color gradients between two specified colors with configurable steps. Access via MCP in Cursor or Windsurf, or call GET /v1/color/gradient directly. Returns RGB hex values for each gradient step — perfect for creating color palettes or smooth transitions. Supports any valid color format as input.
curl "https://tinyfn.io/v1/color/gradient" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/color/gradient', {
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/gradient',
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 the generate_gradient tool with start_color, end_color, and steps parameters. It accepts hex (#FF0000), RGB (255,0,0), or named colors (red) and returns an array of hex color values.
Most implementations support up to 100 steps, though the exact limit depends on your MCP client. For web applications, 10-50 steps usually provide smooth visual transitions.
The tool generates RGB gradients without alpha channels. For RGBA gradients with transparency, you'll need to interpolate alpha values separately or use a different approach.
Uses linear interpolation in RGB color space, calculating intermediate values for each RGB component. This creates perceptually uniform steps but may appear darker in the middle compared to HSL interpolation.
Accepts hex codes (#FF0000, #f00), RGB values (255,0,0), HSL notation, and standard CSS color names like 'red', 'blue', or 'forestgreen'.
Get your free API key and start using Generate Gradient in seconds.
Get Free API Key