Converts RGB color values to HSL (Hue, Saturation, Lightness) format with precise mathematical accuracy. Access via MCP in Cursor or Windsurf for color palette generation, or call GET /v1/misc/rgb-to-hsl directly. Input RGB(255, 128, 0) returns HSL(30°, 100%, 50%). Essential for design workflows requiring perceptual color adjustments.
curl "https://tinyfn.io/v1/misc/rgb-to-hsl" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/misc/rgb-to-hsl', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/misc/rgb-to-hsl',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's miscellaneous tools:
{
"mcpServers": {
"tinyfn-misc": {
"url": "https://tinyfn.io/mcp/misc",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
RGB uses red, green, blue additive values (0-255), while HSL represents hue (0-360°), saturation (0-100%), and lightness (0-100%) — making it more intuitive for human color perception and adjustments.
Call the rgb-to-hsl tool with r=255, g=0, b=128. Returns HSL(318°, 100%, 50%) — a bright magenta with full saturation at medium lightness.
No, this tool expects integer RGB values from 0-255. Use separate hex-to-rgb conversion first, or calculate percentages to the 0-255 range.
HSL makes it trivial to adjust brightness (lightness) or saturation independently, create color harmonies by shifting hue, and generate palettes that feel visually consistent.
Yes, RGB(0,0,0) converts to HSL(0°, 0%, 0%) and RGB(255,255,255) to HSL(0°, 0%, 100%). Hue becomes undefined (0°) when saturation is zero.