Converts RGB color values to hexadecimal format for web development and design workflows. Access via MCP in Cursor or Windsurf, or call GET /v1/convert/color/rgb-to-hex with RGB parameters. Input rgb(255, 128, 0) returns #FF8000. Handles standard RGB ranges (0-255) with proper validation and uppercase hex output.
curl "https://tinyfn.io/v1/convert/color/rgb-to-hex" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/convert/color/rgb-to-hex', {
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/rgb-to-hex',
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"
}
}
}
}
Pass RGB values as parameters to the rgb-to-hex tool in your AI editor. The tool accepts red, green, and blue values from 0-255 and returns the hex color code.
Returns uppercase hex format with hash prefix, like #FF8000 for rgb(255, 128, 0). Always includes the # symbol for direct use in CSS and HTML.
Only accepts standard RGB integers from 0-255. For RGB percentages, convert to integers first (e.g., 50% = 128).
Values outside 0-255 range trigger validation errors. The tool ensures proper RGB bounds before conversion to prevent invalid hex codes.
Perfect for converting design system colors, generating CSS from RGB specifications, or batch processing color palettes through MCP integration in development environments.