Color · Made a little simpler

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.

Free to useNo account neededProcessed on your device
Your workspaceProcessed on your device

The filter is fitted to an opaque black reference pixel. Other source colors can render differently.

Add this tool to your website

Paste this code into your page to add the tool and a visible ToolMellow credit link.

HTML embed code
Preview embed

HEX Color to CSS Filter: how to use it

  1. Enter a three- or six-digit HEX color, or select a preset.
  2. Generate the filter. Compare the target patch and the filtered black patch.
  3. 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.

Guides