Need lighter versions of your colors for backgrounds, highlights, or pastel designs? This guide covers the Color Tint Generator API, which creates lighter variations of any color while maintaining its hue for consistent design systems.
What are Color Tints?
A tint is a color mixed with white, making it lighter. Unlike simply increasing brightness, properly generated tints maintain the color's character while lightening it:
- Original: #3498db (bright blue)
- 10% tint: Slightly lighter
- 50% tint: Pastel blue
- 100% tint: White
Tint Generation Methods
The API can generate tints using different methods:
- HSL lightness: Increases the L value in HSL
- White mixing: Blends with white
- RGB scaling: Moves RGB values toward 255
Using the Color Tint API
TinyFn provides an endpoint for tint generation:
GET https://api.tinyfn.io/v1/color/tint
Headers: X-API-Key: your-api-key
{
"original": {
"hex": "#3498db",
"hsl": { "h": 204, "s": 70, "l": 53 }
},
"tints": [
{ "hex": "#3498db", "percent": 0, "hsl": { "h": 204, "s": 70, "l": 53 } },
{ "hex": "#5dade2", "percent": 10, "hsl": { "h": 204, "s": 70, "l": 62 } },
{ "hex": "#85c1e9", "percent": 25, "hsl": { "h": 204, "s": 70, "l": 72 } },
{ "hex": "#aed6f1", "percent": 50, "hsl": { "h": 204, "s": 70, "l": 81 } },
{ "hex": "#d6eaf8", "percent": 75, "hsl": { "h": 204, "s": 70, "l": 91 } }
]
}
Parameters
| Parameter | Type | Description |
|---|---|---|
color |
string | Base color in HEX, RGB, or HSL format (required) |
amount |
number | Single tint percentage (0-100). Use this OR count. |
count |
integer | Number of tints to generate (2-10). Default: 5 |
method |
string | Method: hsl, mix, rgb. Default: hsl |
Code Examples
JavaScript / Node.js
// Generate a tint palette
const response = await fetch(
'https://api.tinyfn.io/v1/color/tint?' + new URLSearchParams({
color: '#3498db',
count: 5
}),
{ headers: { 'X-API-Key': 'your-api-key' } }
);
const result = await response.json();
// Use for CSS variables
result.tints.forEach((tint, i) => {
console.log(`--color-tint-${i}: ${tint.hex};`);
});
// Get a single specific tint for backgrounds
const bgColor = await fetch(
'https://api.tinyfn.io/v1/color/tint?' + new URLSearchParams({
color: '#3498db',
amount: 85 // Very light for backgrounds
}),
{ headers: { 'X-API-Key': 'your-api-key' } }
).then(r => r.json());
Python
import requests
response = requests.get(
'https://api.tinyfn.io/v1/color/tint',
params={'color': '#e74c3c', 'count': 7},
headers={'X-API-Key': 'your-api-key'}
)
result = response.json()
print(f"Tints for {result['original']['hex']}:")
for tint in result['tints']:
print(f" {tint['percent']}%: {tint['hex']}")
cURL
curl "https://api.tinyfn.io/v1/color/tint?color=%233498db&amount=60" \
-H "X-API-Key: your-api-key"
Common Use Cases
- Backgrounds: Light tints for page and card backgrounds
- Highlights: Selection and focus highlights
- Alerts: Success/error backgrounds with tinted colors
- Pastels: Create pastel color palettes
- Design Systems: Build comprehensive color scales
Best Practices
- High tints for backgrounds: Use 80-95% tints for subtle backgrounds
- Maintain contrast: Ensure text remains readable on tinted backgrounds
- Be consistent: Use the same tint percentages across your design system
- Combine with shades: Generate both tints and shades for complete scales
Use via MCP
Your AI agent can call this tool directly via Model Context Protocol — no HTTP code needed. Add TinyFn to Claude Desktop, Cursor, or any MCP client:
{
"mcpServers": {
"tinyfn-color": {
"url": "https://api.tinyfn.io/mcp/color/",
"headers": {
"X-API-Key": "your-api-key"
}
}
}
}
See all color tools available via MCP in our Color MCP Tools for AI Agents guide.
Try the Color Tint Generator API
Get your free API key and start generating color tints.
Get Free API Key