Converts CSS color names like "red" or "steelblue" to hex codes. Use via MCP in Cursor or Windsurf for instant color conversion, or call GET /v1/color/name-to-hex?name=crimson. Returns precise hex values like #DC143C for all 147 standard CSS colors. No guesswork — deterministic mapping from W3C specifications.
curl "https://tinyfn.io/v1/color/name-to-hex" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/color/name-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/color/name-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 color tools:
{
"mcpServers": {
"tinyfn-color": {
"url": "https://tinyfn.io/mcp/color",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
All 147 standard CSS color names from the W3C specification, including basic colors like 'red', 'blue', extended colors like 'steelblue', 'mediumorchid', and system colors.
Just ask your AI assistant to convert a color name. The MCP tool will automatically call the conversion function and return the exact hex code.
The tool returns an error for unrecognized names. Only official CSS color names are supported — 'lightred' won't work, but 'lightcoral' will.
CSS color names are case-insensitive by specification, so 'RED', 'red', and 'Red' all return the same hex value #FF0000.
This tool specifically returns hex format. Use TinyFn's separate hex-to-rgb converter if you need RGB values from the hex output.