Programmatically darken any color by a specified percentage through `/v1/color/darken`. Pass a hex, RGB, or HSL color with a darkness percentage (0-100) to get the darkened result. Perfect for creating hover states, shadows, or theme variations in AI-generated designs. Works seamlessly with MCP tools in Cursor and other editors.
curl "https://tinyfn.io/v1/color/darken" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/color/darken', {
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/darken',
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(14,100%,60%)), and named colors (red, blue). Returns the darkened color in the same format you provide.
Call the darken tool with your color and percentage: darken('#3498db', 30). The tool returns the darkened hex value you can use directly in your CSS or design system.
Black (#000000) remains black when darkened. Very dark colors may show minimal visual change since there's limited room to reduce brightness further.
Yes, you can darken by 0-100%. Higher percentages create very dark or near-black results, useful for deep shadows or high-contrast themes.
Darkening reduces brightness/lightness while preserving hue and saturation. Desaturation makes colors more gray. Use darkening for depth, desaturation for muted tones.
Get your free API key and start using Darken Color in seconds.
Get Free API Key