Converts HSL color values to hexadecimal format with precise calculations. Use via MCP in Cursor or Windsurf for instant color conversions, or call GET /v1/color/hsl-to-hex directly. Input hsl(240, 100%, 50%) returns #0000FF. Handles full HSL range including edge cases like 0% saturation gracefully.
curl "https://tinyfn.io/v1/color/hsl-to-hex" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/color/hsl-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/hsl-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"
}
}
}
}
Accepts standard HSL notation like hsl(240, 100%, 50%) and individual H/S/L parameters. Hue ranges 0-360°, saturation and lightness 0-100%.
Enable TinyFn's MCP tools in Cursor, Claude Code, or Windsurf. Ask 'convert hsl(180, 50%, 75%) to hex' and get instant, accurate results without manual calculation.
Yes, properly converts grayscale (0% saturation) and extreme lightness values. hsl(0, 0%, 50%) correctly becomes #808080, not approximated values.
HSL uses lightness (0% = black, 100% = white), while HSV uses brightness/value. Same hue/saturation values produce different colors in each system.
The endpoint processes single conversions. For batch operations, make multiple API calls or use the MCP tool repeatedly in your AI assistant workflow.