HEX Color to CSS Filter
Convert an RGB HEX color into a CSS filter for a black icon. Compare target, modeled and browser-rendered colors, check the channel error and copy the declaration.
Match a CSS Filter to a Black Icon
The filter is fitted to an opaque black reference pixel. Other source colors can render differently.
HEX Color to CSS Filter: how to use it
- Enter a three- or six-digit HEX color, or select a preset.
- Generate the filter. Compare the target patch and the filtered black patch.
- Check the measured RGB channel error, then copy the CSS declaration.
Limits and notes
Uses a black reference pixel and opaque sRGB targets. Filter values approximate the requested color. Canvas measurement depends on browser support, and screenshot or application output can differ by a few channel values.
How your privacy works →HEX Color to CSS Filter: common questions
Which source color should I use?
Use an opaque black mark as the reference. Transparent backgrounds are fine, but compare the interior of the icon when checking the color.
What does maximum RGB channel error measure?
It is the largest absolute difference between a target and rendered 8-bit red, green or blue value. An error of 2 means every channel is within two points.
Why can the model and browser results differ?
The model uses numerical CSS color transformations. The browser may round or clip intermediate values differently when it paints the filter.