Repeating geometric patterns add structure to a background without the weight of a photo. This generator builds one tile — a square, triangle, hexagon, or diamond — as a tiny SVG, then hands you the CSS to tile it across any element. Vector output means it stays crisp on any display.
How it works
A single motif is drawn inside a square tile, and the browser repeats that tile via
background-image plus a matching background-size:
<svg width="40" height="40">
<rect width="100%" height="100%" fill="#0f172a"/>
<polygon points="20,2 38,20 20,38 2,20" fill="none" stroke="#3b82f6" stroke-width="2"/>
</svg>
Hexagons are computed from six points around the tile centre at 60-degree steps;
triangles and diamonds are simple polygons; squares are an inset rect. Filled mode
sets a solid fill, while outline mode uses fill="none" with a stroke.
Tips and notes
For backgrounds behind body text, outline mode at low opacity reads as gentle
texture rather than visual noise. Match background-size to the tile width exactly
(the copied CSS already does this) so the motif never stretches. Hexagons and
triangles look best with a tile size of 30–60px; smaller tiles turn dense and busy.
Because the tile is plain SVG, you can also paste it inline and animate the stroke
colour with CSS for a subtle hover effect.