Skip to main content

Multicolor pixel engine

Name: multicolor-pixel. Output: SVG. A pixel-grid avatar that fills cells from a generated multi-color palette derived from the seed.

Avatar::engine('multicolor-pixel')
->seed('user@example.com')
->size(256)
->pixels(6)
->symmetry(true)
->numColors(4)
->fillAll(true)
->generate();

Options

OptionMethodTypeDefault
Grid sizepixels()int5
Horizontal symmetrysymmetry()booltrue
Palette sizenumColors()int5
Fill all cellsfillAll()booltrue

The palette is built from the seed's base hue, fanning the hue, lightness, and saturation across numColors entries. Each cell's color is chosen from the palette by a position-dependent hash.

With fillAll enabled (the default) every cell in the grid is painted. With it disabled, only the cells set in the generated pixel matrix are painted, leaving the rest transparent.