Mathematically blends two colors using linear interpolation in RGB space. Call via MCP in Cursor or Windsurf, or REST at GET /v1/color/blend with color1, color2, and ratio parameters. Example: blending #FF0000 (red) with #0000FF (blue) at 50% ratio yields #800080 (purple). Returns precise hex values for consistent color mixing.
curl "https://tinyfn.io/v1/color/blend" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/color/blend', {
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/blend',
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"
}
}
}
}
Uses linear interpolation in RGB space. Each RGB channel is calculated as: channel1 * (1 - ratio) + channel2 * ratio, then converted back to hex format.
Accepts hex colors (#FF0000, #f00), RGB values (rgb(255,0,0)), and named colors (red, blue). Always returns hex format for consistency.
Yes, the MCP tool integrates directly. Useful for generating color palettes, creating gradients, or finding midpoint colors between brand colors in design systems.
0% returns the first color unchanged, 100% returns the second color unchanged. Use 50% for exact middle blending between colors.
Similar results for simple blending, but this tool uses pure RGB interpolation while CSS color-mix supports multiple color spaces (sRGB, HSL, LCH).
Get your free API key and start using Blend Colors in seconds.
Get Free API Key