Converts any color format to grayscale using perceptual luminance weighting. Use via MCP in Cursor or Windsurf, or call GET /v1/color/grayscale with hex, RGB, or HSL input. Returns precise grayscale values in multiple formats. Uses the standard luminance formula (0.299*R + 0.587*G + 0.114*B) for accurate human perception.
curl "https://tinyfn.io/v1/color/grayscale" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/color/grayscale', {
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/grayscale',
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 hex (#FF5733), RGB (rgb(255,87,51)), HSL (hsl(12,100%,60%)), and named colors (red, blue). Returns grayscale in hex, RGB, and HSL formats.
Uses the standard perceptual luminance formula: 0.299*Red + 0.587*Green + 0.114*Blue. This weights green highest since human eyes are most sensitive to green light.
Yes, AI agents in Claude Code or Cline can call this tool repeatedly for color palette analysis, UI mockup processing, or accessibility testing workflows.
Simple averaging treats all colors equally, but this uses perceptual weighting. #00FF00 (pure green) becomes much lighter than #FF0000 (pure red) due to human vision sensitivity.
Alpha channels are maintained when present in the input format. The RGB values are converted to grayscale while keeping the original transparency level intact.
Get your free API key and start using Grayscale Color in seconds.
Get Free API Key