Skip to content

How to compose a filter from the eight controls

The workbench composes one filter declaration from eight functions: brightness, contrast, saturate, grayscale, sepia, hue-rotate, blur and opacity. Choose the property first — filter paints on the element itself, backdrop-filter paints on whatever sits behind it — then move the controls and watch the live stage update.

The export panel holds the finished declaration: a single filter line, or the pair of backdrop-filter lines with the -webkit- prefix Safari still needs. Copy them into your own rule. Nothing leaves the browser, and the page keeps working offline.

  1. Choose filter or backdrop-filter under CSS property. The backdrop variant only shows on a surface you can see through, so the preview keeps a translucent panel in front of the coloured shapes.
  2. Start from a preset — Vivid, Monochrome, Warm or Frosted glass — or set the eight values yourself. Editing any field switches the preset list back to Custom.
  3. Adjust the values and watch the live stage: the preview redraws at every keystroke, and the readout names the property currently in use.
  4. Read the export panel. Functions left at their neutral value are dropped, so a blur-only effect exports as filter: blur(4px) rather than eight inert functions.
  5. Press Copy CSS, paste the declaration into your stylesheet, and press Reset to return every control to neutral. Frosted glass also switches the property back to backdrop-filter.

What filter and backdrop-filter really do

filter and backdrop-filter are different properties

filter applies to the element and everything it paints, children and text included. backdrop-filter leaves the element itself alone and filters the pixels behind it, which is why a glass panel needs a partially transparent background before the effect is visible at all.

Support is not identical: Safari still requires the -webkit-backdrop-filter prefix, and the export panel writes both lines for that reason. When an engine does not support the property it ignores the declaration and the element renders normally, so treat glass as decoration rather than structure.

How the eight functions combine

Each control maps to one CSS function: brightness, contrast and saturate take percentages around the neutral 100%; grayscale, sepia and opacity run from 0 to 100%; hue-rotate takes degrees from -360 to 360; blur takes pixels in 0.5 steps. They are written in a fixed order and apply in that order, so hue-rotate(-8deg) before blur(14px) does not always match the reverse.

A value left at its neutral position is omitted from the output. The string is still a single declaration, so each function transforms the result of the one before it rather than the original pixels.

Ranges, snapping and cost

Every field is clamped to its own range before the CSS is written — brightness and contrast 0–300, saturate 0–500, grayscale, sepia and opacity 0–100, hue-rotate -360–360, blur 0–40 in 0.5 steps. Typing -5 into blur or 500 into grayscale snaps back to 0 and 100 when the field loses focus, and an empty field returns to the value it had. That keeps the exported declaration valid: browsers drop the whole filter when one function carries a value they cannot parse.

filter and backdrop-filter are composited on the GPU and blur is the expensive function; a 14px backdrop blur across a large area can cost more than everything else combined, especially while scrolling. Keep the blurred surface small, and test on the slowest device you support before shipping the effect.

Recent tools: