CSS & Gradients
HEX to CSS Filter Generator
Colorize black PNG or external image icons to match any brand color using pure CSS filter properties, with live side-by-side preview.
Target Color
#2563EB
Filtered Black ResultPerfect (Loss 0.04)
Approx #2663EC
Sample Monochrome Icon
Black fill SVG tinted solely via CSS filter
Generated CSS Declaration
.icon-tint {
filter: brightness(0) saturate(100%) invert(34%) sepia(99%) saturate(1031%) hue-rotate(202deg) brightness(87%) contrast(115%);
}How to Use This Tool
- Enter or pick your target brand HEX color.
- Inspect the computed perceptual loss rating ("Perfect", "Close", or "Approximate") and side-by-side preview icons.
- Click Recompute if you want another stochastic search seed, then copy the CSS filter property.
Key Features
- Pure TypeScript SPSA multi-start optimizer solves accurate filter chains in milliseconds
- Displays Target Swatch beside Simulated Filter Swatch plus numeric Perceptual Loss indicator
- Live preview rendered over sample monochrome UI icons on Light & Dark surfaces
- One-click copy for complete CSS filter declaration and "Solve Lower Loss" recompute option
Frequently Asked Questions
If you control the SVG asset, inline currentColor is cleaner; CSS filter works great when tinting external black <img> icons or legacy PNG masks via pure CSS.
More Color Tools
View all tools →SVG Recolor Tool
Remap fills and strokes in any SVG file, shift hues, or convert icons to currentColor.
Open tool
Color Converter
Convert single or bulk colors across HEX, RGB, HSL, OKLCH, P3, CMYK, and mobile formats.
Open tool
Color Picker & Eyedropper
Pick exact colors in HEX, RGB, HSL, or OKLCH and sample pixels directly from your screen.
Open tool