All effectsVisual styles

Halftone

半调网点

A printed-looking tone is built from dots that vary in size.

Compare the dot sizes from left to right

Where to use it

Bring a comic-book or print feel to a graphic panel or poster accent. Choose a dot size that holds its shape at the smallest display width, and leave a quiet area for small print.

Practical example

An independent cinema promotes a comic-book film series with a halftone illustration of a projector. Larger dots build its dark shadow and smaller dots leave space for the light cone, while dates stay on a solid panel.

AI prompt

Apply Halftone to [target graphic]. Simulate brightness using dot radius on a regular screen, with smaller dots in lighter zones. Use a low-contrast palette near text and check the rendered dot size at the smallest target viewport.

Example code

Save the standalone HTML as a file and open it in your browser. It uses the same code as the preview.

View HTML
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Halftone</title>
  <style>
    :root {
      color-scheme: dark;
      --demo-bg: #171629;
      --demo-ink: #f8f5ff;
      --demo-accent: #b9a6ff;
      --demo-muted: #bfbbd3;
      font-family: system-ui, sans-serif;
      color: var(--demo-ink);
      background: var(--demo-bg);
    }

    *, *::before, *::after { box-sizing: border-box; }
    body { margin: 0; min-width: 0; }
    button, input { font: inherit; }

    .demo {
      display: grid;
      place-items: center;
      align-content: center;
      min-height: 100vh;
      padding: 14px;
      overflow: hidden;
      background: radial-gradient(ellipse at 50% 24%, #28233f, var(--demo-bg) 78%);
    }

    .demo-button {
      border: 1px solid #ffffff3d;
      border-radius: 7px;
      background: #ffffff12;
      color: var(--demo-ink);
      padding: 6px 11px;
      font-size: 12px;
      cursor: pointer;
    }

    :focus-visible {
      outline: 2px solid var(--demo-accent);
      outline-offset: 3px;
    }

    .visual-specimen {
      width: min(100%, 290px);
      height: 124px;
      display: grid;
      place-items: center;
      position: relative;
      isolation: isolate;
    }
    .halftone { display: flex; width: min(100%, 231px); height: 99px; background: #f3c780; border-radius: 9px; overflow: hidden; }
    .halftone i { flex: 1; background: radial-gradient(circle, #773a51 var(--radius, 7px), transparent calc(var(--radius, 7px) + .45px)) 0 0 / 18px 18px; }
    .halftone i:nth-child(2) { --radius: 5px; }
    .halftone i:nth-child(3) { --radius: 3.2px; }
    .halftone i:nth-child(4) { --radius: 1.7px; }
  </style>
</head>
<body>
  <main class="demo">
    <div class="visual-specimen" aria-hidden="true"><div class="halftone"><i></i><i></i><i></i><i></i></div></div>
  </main>
</body>
</html>

Original example by UI Skills