Color Utilities

Darken Color

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.

API Endpoint

GET /v1/color/darken

Code Examples

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)

Use via MCP

Add to your AI agent

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"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

What color formats does the darken color tool accept?

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.

How do I darken a color by 30% using MCP in Cursor?

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.

What happens if I try to darken black or very dark colors?

Black (#000000) remains black when darkened. Very dark colors may show minimal visual change since there's limited room to reduce brightness further.

Can I darken colors by more than 50% safely?

Yes, you can darken by 0-100%. Higher percentages create very dark or near-black results, useful for deep shadows or high-contrast themes.

What's the difference between darkening and reducing saturation?

Darkening reduces brightness/lightness while preserving hue and saturation. Desaturation makes colors more gray. Use darkening for depth, desaturation for muted tones.

Try Darken Color Now

Get your free API key and start using Darken Color in seconds.

Get Free API Key