Skip to main content

Module avatar

Module avatar 

Source
Expand description

The blob avatar: one silhouette, two eyes and a little life.

The shape is a radial profile rather than a pick from a roster, so a preset, a name and Shape::random are the same kind of value and there is no vocabulary to outgrow. Colour comes from the theme.

mascot draws the same face as cells — one identity at two resolutions, since a rail and a chat header showing one name should show one being.

agent::avatar(Face::from("Sara").pose(t)).w(px(48.)).h(px(48.))

Structs§

Beat
The moving parts at one instant.
Eye
One eye where it lands, in the same unit space as Shape::outline.
Eyes
Face
A face: what to draw, and what to draw it in.
Lobe
One harmonic of the outline: k bumps around the circle.
Motion
Pose
One face at one instant. A Shape’s harmonics are not interpolable — a count of lobes has no half — so blending happens here, where the outline is already sampled.
Shape

Constants§

GRID
Cells across the sprite.
SAMPLES
Points the outline is sampled at. Corners land between samples, so the spline through them is rounded by the sampling itself.

Functions§

avatar
The element, filling its layout bounds.
mascot
The element, filling its layout bounds.
seed
FNV-1a over a canonical form of the name — lowercased, outer whitespace dropped and inner runs collapsed to one space — so the same person keeps the same face across whatever the keyboard did.