Validates hex color strings with precise formatting rules. Use via MCP in Cursor or Windsurf, or call GET /v1/color/is-valid-hex with your color string. Returns true/false for formats like #FF0000, #abc, or abc. Perfect for form validation or AI agents processing user-submitted colors without guessing.
curl "https://tinyfn.io/v1/color/is-valid-hex" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/color/is-valid-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/is-valid-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"
}
}
}
}
Accepts 3-digit (#abc), 6-digit (#FF0000), and versions without the hash prefix (abc, FF0000). Case insensitive for A-F characters.
Call the is-valid-hex tool directly in Cursor, Windsurf, or other MCP editors. Pass the color string as a parameter and get instant true/false validation.
No, only validates hexadecimal color notation. Use a separate CSS color validator for named colors or rgb() values.
Returns false for any non-hexadecimal characters (G-Z) or incorrect length. Strict validation prevents malformed colors from passing through.
No, validates one color per request. For batch validation, make separate API calls or use the MCP tool iteratively in your AI workflow.
Get your free API key and start using Is Valid Hex in seconds.
Get Free API Key