CSS Filter Playground
Stacks blur, brightness, saturation, hue and drop-shadow filters on a sample and emits the CSS.
Stacks the CSS filter functions on a sample and gives you the declaration. The preview is rendered by the browser’s own `filter` property, so what you see is definitionally what the CSS does rather than an approximation of it. The extra thing here is the equivalent `feColorMatrix`: every one of these functions except blur and drop-shadow is affine in RGBA, so a chain of eight collapses into twenty numbers.
Preview
Rendered by the browser's own filter property, so this is what the CSS below does — not an approximation of it.
CSS
Filters
How to use it
Choose what to look at
Flat swatches show what happens to specific colours, the gradient shows what happens across a range including the greys, and your own image shows what happens to the thing you are actually filtering. Judge on the last one before shipping.
Move the functions you need
Anything left at its neutral value is omitted from the output entirely, so the CSS stays as short as what you actually changed. Order matters and follows the order of the list.
Add drop-shadow last if you want one
It is a separate block because it takes three numbers and a colour rather than one amount, and because it follows the alpha channel — it traces the shape of a transparent PNG rather than its box.
Take the CSS, or take the matrix
The CSS is for a stylesheet. The `feColorMatrix` is for an SVG filter, a shader, or any pipeline where running eight passes to do what one matrix multiply does is worth avoiding.
Common questions
Why is blur missing from the matrix?
Because it is spatial: a blurred pixel depends on its neighbours, and a colour matrix only ever looks at one pixel at a time. The same goes for drop-shadow. The panel names whichever ones could not collapse and leaves them as a separate step rather than quietly dropping them.
hue-rotate(180deg) did not give me the complementary colour.
It never does. The function is a rotation about the luminance axis of the non-linear RGB cube, which the spec defines with a fixed matrix — it is not a perceptual hue rotation and it was not designed to be one. For an actual complement, rotate the hue in OKLCH with the colour converter or the palette generator.
Does grayscale(1) use the right luminance coefficients?
It uses the ones the spec mandates: Rec. 709, applied to gamma-encoded values. Applying luminance weights to non-linear values is, strictly, wrong — a proper desaturation linearises first. The spec says to do it this way and browsers do, so this reproduces the mismatch rather than correcting it, because agreeing with the browser is the point.
Does this cover backdrop-filter?
The functions are the same, so the value you copy is valid there too. What is different is the source — `backdrop-filter` filters whatever is painted behind the element, not the element — so the preview here will not tell you how a frosted panel looks over your real content. Paste it into the page and look.
Feed it from
Box Shadow Generator
Composes layered box and text shadows with a live preview and emits the CSS.
Colour Picker
Picks a colour on an OKLCH field, with a screen eyedropper or from an uploaded image, and copies it in any notation.
Colour Format Converter
Converts a colour between HEX, RGB, HSL, HWB, LAB, LCH and OKLCH and names the nearest known colour.
Contrast Checker
Scores a foreground and background pair against WCAG 2 and APCA and suggests the nearest passing colour.
Next
These accept what this tool produces, so the result can go straight in.
CSS Beautifier & Minifier
Formats or minifies CSS without reordering anything, preserving the token stream exactly.
Brightness & Colour Adjust
Adjusts brightness, contrast, saturation, temperature and sharpness with a live histogram.
Box Shadow Generator
Composes layered box and text shadows with a live preview and emits the CSS.
Colour Format Converter
Converts a colour between HEX, RGB, HSL, HWB, LAB, LCH and OKLCH and names the nearest known colour.
Colour Picker
Picks a colour on an OKLCH field, with a screen eyedropper or from an uploaded image, and copies it in any notation.
Contrast Checker
Scores a foreground and background pair against WCAG 2 and APCA and suggests the nearest passing colour.