Pixel UI/Backgrounds/Mesh gradient

Mesh gradient

Soft colour blobs that drift into each other, the classic SaaS gradient, rebuilt out of pixels.

<piix-shader>WebGL
Palette

Four colour fields drift on slow noise and blend into each other, then get dithered down into the palette on a pixel grid. The pointer pulls the nearest blob toward it. Calm enough to sit behind body text.

Installation

<!-- once, anywhere on the page: every component -->
<script src="https://cdn.jsdelivr.net/npm/piixpal@0.6/piixpal.min.js"></script>

Usage

<piix-shader kind="mesh" height="420px"></piix-shader>

Examples

Behind your content

With fill it sits behind everything else in the element it's in. Give that element position: relative (the shader does this for you if it's static).

Ship it loud

Your content sits on top.

Other palettes

Every palette works with every background.

Smooth bands

dither="0" swaps the dither pattern for flat colour bands, like a poster.

API reference

AttributeWhat it doesDefault
kindmesh warp aurora crystal liquid horizon nebula topo dots firemesh
palettethe colours: lime aurora sunset ocean candy violet fire gameboy paper mono, or your own, dark to light: "#000,#6b4cff,#fff"candy
pixelsize of one pixel, in px4
dither0 for flat colour bands, 1 for full dither1
speed1 is normal, 0 holds still1
heightwhen not filling: px or any CSS length360px
fillsit behind the content of the parent element–

Accessibility