Vector styles
The vector series draws a character as smooth SVG paths. It has seven variants that differ in paint only: the geometry, the animation and the face are the same in all of them, so a new state or a new shape arrives in every variant at once.
solid, outline and glass are described with the CharacterMark props. This page covers the other variants, and the one-colour line look that outline gives.
Sticker
A sticker is a figure with a white border cut round it and a small soft shadow under it, as if it had been stuck onto the page. The border wraps the body and the notification badge as one silhouette, and it is drawn inside the body's transform, so it squashes, turns and fades with the body — through a bounce, a spin or a belt.
The paper does not follow the page. A sticker is a thing with its own edge, so on a dark page it stays light — that contrast is what lifts it off the surface. For the same reason its eyes are paper too, rather than holes that would show the page through. A host that wants a cream or a tinted edge sets --aora-paper on any ancestor:
stickerWidth is how far the border reaches beyond the body, in shape-space units, so it scales with the character: a 24-pixel avatar gets a border about one pixel wide. stickerShadow turns the drop shadow off, which is what you want on a busy background or in a long list.
Paper
A paper cut-out lies on a darker copy of itself, offset down and to one side, with no blur: a hard shadow. paperOffset is the distance in shape-space units and paperAngle the direction in degrees, clockwise from the right — 90 is straight down.
Two decisions are worth knowing.
- The shade comes from the ink, not from a second colour. The shadow is a copy of the body in the same paint with black laid over it at 32%, so it is the ink, darkened. That works whatever the ink is — the
--aora-fgtoken, a flat colour, a gradient — whichcolor-mix()on a computed colour would not do for the last. - The direction does not turn with the body. The offset is applied outside the body's transform. When the character spins the shadow squashes and rotates with it but keeps falling the same way, like a light that stays where it is.
The figure itself stays upright. A slight tilt would be a pose, and poses belong to the simulation (poseHome), not to paint, so paper never changes where the face or the belt is.
Soft
soft is a rounded toy: the flat body under a radial wash (light at the top left, dark at the bottom right) and a shadow on the ground that stays put when the body hops. The face is dark brown and the blush leans pink. A small gloss at the top left is off by default (softGloss), because on a shape whose face sits high it lands on an eye. The wash and the gloss are overlays on the body rather than a gradient computed from the ink, so they work on a token, a colour or a gradient ink. Parts such as ears take the wash too, so their shading matches where they sit on the figure.
Riso
riso imitates two-colour stencil printing: the body is printed in its own ink in place, multiplied over a copy in the second ink (--aora-ink2, pink by default and gold on a pink body) shifted a little to one side, with a halftone screen over the top. The edge where the two passes miss each other is the look of this variant. risoOffset is the misregistration in shape-space units, and risoHalftone switches the screen.
A single line
The outline variant already is the single-line look. What decides whether it is one colour is its ink. With no ink the stroke, the eyes and the features use --aora-fg, and CharacterMark sets that to the palette colour — so the outline is blue, violet, whatever color says. To draw in the text colour instead, give it currentColor:
Everything in the character takes the ink: the outline, the eyes, the line face, the HUD dials and, for a flat ink, the belt's dots and rings. Nothing is tied to a palette entry, so the character sits in any theme without a colour of its own.
From the engine:
A static render takes the same ink:
Inline that markup in the page. Loaded through an <img>, an SVG has no surrounding text colour to inherit and currentColor becomes black.
Parameters
Parameters belong to the series and every variant reads only its own. Out-of-range numbers are clamped and snapped to the step; a value of the wrong type falls back to the default; unknown keys are dropped.
Pick a variant and the panel lists only the parameters that variant reads. It is built from the registry, so it stays in step with the table above.
variant can change on a running character; the paint is redrawn at once, even while the character is paused. styleOptions is resolved from the defaults on every update rather than merged into the last one, so pass every value you want to keep. validateStyleOptions(getStyle('vector'), options) reports what resolving would have silently repaired.
Next
- CharacterMark — the component, and the first three variants
- Kaomoji style — the character written as one line of text
- Faces — the three faces that every variant can wear
- Theming — the variables that paint a character