Tools38

Icon recolor code

CSS Filter Solver.

Turn any target HEX color into a ready-to-paste CSS filter and exact SVG feColorMatrix for monochrome icons.

Active palette
CSS Filter Rule ΔE 0.2 · Works on <img> & icons
filter: brightness(0) saturate(100%) invert(18%) ...;
Exact CSS Data-URI Filter ΔE 0.0 · Mathematically exact sRGB
filter: url("data:image/svg+xml,...");
SVG <feColorMatrix> ΔE 0.0 · Preserves alpha channel
<filter id="recolor"><feColorMatrix ... /></filter>

Export palette

Import colors

Paste CSS variables, JSON tokens, a Coolors URL, or comma-separated HEX / RGB / OKLCH values (3–8 colors).

Try:

Saved Palettes

Stored in your browser cache—no account required.

Blog How to convert any HEX color to a CSS filter() rule Read the guide

Recolor monochrome PNG and external SVG icons to any target HEX in CSS

When you cannot edit an icon's inline SVG fill—such as an <img> tag or external sprite—solve the exact CSS filter chain and 0.0 ΔE SVG feColorMatrix needed to turn it into your target brand color.

Sub-1.0 ΔE CSS filter optimizer paired with mathematically exact SVG feColorMatrix.
QUICK VIDEO TUTORIAL How to convert any HEX color to a CSS filter() rule Recolor external <img> icons in pure CSS—with chained filter() or 0.0 ΔE SVG matrix. Watch the video

How to convert any HEX color to a CSS filter() rule

Three ways to recolor icons in CSS

Pure CSS

invert · sepia · hue-rotate chain

Multi-start coordinate-descent solver finds high-accuracy CSS filter chains in milliseconds.

Zero Error

Exact 0.0 ΔE Data-URI filter

One-line CSS filter: url("data:image/svg+xml,...") rule that hits your exact sRGB byte values.

Inline SVG

Reusable <feColorMatrix>

Copy clean SVG filter defs that recolor RGB channels while preserving smooth anti-aliased alpha edges.

Key capabilities

Multi-start CSS filter optimizer

Solves W3C Filter Effects chains (invert, sepia, saturate, hue-rotate, brightness, contrast) in under 4ms.

ΔE accuracy

Compares real target HEX against live CSS-filtered swatches and monochrome UI icons.

Exact 0.0 ΔE SVG feColorMatrix

Generates both inline <feColorMatrix> markup and single-line CSS Data-URI filter rules with zero color error.

Alpha-safe

Recolors opaque and semi-transparent icon pixels accurately while keeping anti-aliased edges crisp.

6 live bidirectional color spaces

Converts simultaneously between HEX, OKLCH, RGB, HSL, D65 CIELAB, and process CMYK.

Omnibox parsing

Type or paste in any card—or drag perceptual OKLCH sliders—to update all six spaces in real time.

Synced active palette across tools

Move freely between Generator, Visualizer, Contrast, Tailwind, and Vision without re-entering colors.

How state travels

Your active palette syncs automatically in browser storage across every module, and visiting any tool directly starts from a fresh harmonious palette.

Formats & privacy

Supported inputs
Target HEX, OKLCH, RGB, Tailwind Token, or Classic RAL
Outputs & exports
CSS filter Chain, Data-URI Filter, and SVG <feColorMatrix>

Supports 3 to 8 active palette roles with unlimited local saves and exports—no account required.

All color math, simulations, and exports run locally in your browser while syncing your active palette across tools.

FAQ

Good to know.

A few answers before you get started.

On your device
When should I pick 'Any color icon' vs. 'Black icon'?

Use 'Any color icon' if your source image is white, gray, or colored—brightness(0) saturate(100%) normalizes all opaque pixels to black first. If your icon is already pure #000000 black, 'Black icon' outputs a shorter rule.

Why does Data-URI feColorMatrix achieve ΔE 0.0?

Unlike sepia/hue-rotate approximations, an SVG feColorMatrix sets output R, G, and B channels directly from your target color's exact normalized sRGB values while preserving original pixel alpha.

Why do you provide both CSS filter() and SVG feColorMatrix?

Chained CSS filters (invert/sepia/hue-rotate) are convenient one-liners, while an inline SVG feColorMatrix achieves mathematically exact 0.0 ΔE color matching.

Should my source icon be black before applying the CSS filter?

The CSS filter chain starts with brightness(0) saturate(100%), which normalizes any opaque icon silhouette to pure black automatically before tinting.

Language38

EnglishالعربيةFrançaisItalianoDeutschEspañolPortuguêsNederlandsРусскийTürkçe日本語中文हिन्दीBahasa IndonesiaBahasa Melayu한국어Tiếng ViệtไทยPolskiSvenskaУкраїнськаNorskবাংলাΕλληνικάفارسیاردوČeštinaDanskMagyarRomânăSuomiБългарскиFilipinoქართულიSlovenčinaAzərbaycancaעבריתSlovenščina