Converts hex color codes to RGB values with precise decimal output. Access via MCP in Cursor or Windsurf, or call GET /v1/convert/color/hex-to-rgb directly. Input "#FF5733" returns rgb(255, 87, 51). Handles both 3-digit and 6-digit hex formats, with or without the hash prefix.
curl "https://tinyfn.io/v1/convert/color/hex-to-rgb" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/convert/color/hex-to-rgb', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/convert/color/hex-to-rgb',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's conversion tools:
{
"mcpServers": {
"tinyfn-conversion": {
"url": "https://tinyfn.io/mcp/conversion",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Use the hex-to-rgb tool in any MCP-enabled editor like Cursor or Cline. Pass the hex value (e.g., '#3498db') and get back RGB components as separate numbers or formatted string.
Supports 3-digit (#RGB), 6-digit (#RRGGBB), and both with or without the hash prefix. Examples: 'F00', '#FF0000', 'ff0000' all work for red.
Returns RGB as decimal integers 0-255. Typically structured as {r: 255, g: 87, b: 51} or similar object format, not CSS rgb() strings.
The endpoint processes one hex color per request. For batch operations, make multiple API calls or use the MCP tool iteratively in your AI workflow.
Provides deterministic server-side conversion with guaranteed precision, unlike browser-dependent CSS parsing. Essential for AI agents needing reliable color math without hallucination.