Color to CSS Filter
Convert any target color to a CSS filter property — perfect for recoloring SVG icons in img tags without changing the source file.
What Does This Tool Do?
Calculates the CSS filter values (invert, sepia, saturate, hue-rotate, brightness, contrast) needed to transform a black SVG/PNG into your target color. Useful when you can't modify the SVG source.
Key Features
How to Use This Tool
- Enter your target HEX color.
- Click Convert to get the CSS filter string.
- Apply the filter to your img or svg element in CSS.
How It Works
Converts the target color to HSL, then computes a series of CSS filter steps (invert → sepia → saturate → hue-rotate → brightness → contrast) that approximates the target color when applied to a black image.
Common Use Cases
Frequently Asked Questions
Does it work perfectly on all colors?
The result is an approximation. Very saturated or very dark colors may have a small error. The algorithm optimizes for visual accuracy.
Related Tools
Link to This Tool
Copy and paste the code below to link to this tool from your website: