Expand description
Default AvatarStyle impl driven by paint-recipe data.
RecipeAvatarStyle ports the IntUI avatar chrome exactly: the
shape-aware background fill (with hash-derived palette pick when no
caller override is supplied), the optional border ring drawn over
the inner content to mask any image bleed at the rim, the keyboard
focus ring hugging the configured shape, and the presence
indicator dot positioned at one of the four corners with a
surface_main-coloured outline.
The chrome helpers (hash_pick_palette_color, auto_contrast_text,
paint_border, paint_focus_ring, fnv1a_64, avatar_pixel_size)
live here so custom AvatarStyle implementations can reuse them
when they only want to swap one piece of the chrome.
Structs§
- Avatar
Recipe - Dimension recipe for
RecipeAvatarStyle. - Recipe
Avatar Style - Default
AvatarStyleshipped with Teksilo.
Constants§
- AVATAR_
BORDER_ DEFAULT - Default border (ring) thickness when
.border()is called without an explicit width override. - AVATAR_
FONT_ RATIO_ 1CHAR - Initials font-size as a fraction of avatar diameter.
- AVATAR_
FONT_ RATIO_ 2CHAR - AVATAR_
PRESENCE_ DIAMETER_ MAX - AVATAR_
PRESENCE_ DIAMETER_ MIN - AVATAR_
PRESENCE_ DIAMETER_ RATIO - Presence dot diameter as a fraction of avatar diameter.
- AVATAR_
PRESENCE_ INSET - Inset of the presence dot from the avatar’s bounding box edge.
- AVATAR_
PRESENCE_ OUTLINE_ WIDTH - Outline drawn around the presence dot.
- AVATAR_
ROUNDED_ RADIUS_ RATIO - Corner-radius ratio for
AvatarShape::RoundedSquare. - AVATAR_
SIZE_ LARGE - AVATAR_
SIZE_ MEDIUM - AVATAR_
SIZE_ SMALL - AVATAR_
SIZE_ X_ LARGE
Functions§
- auto_
contrast_ text - Auto-contrast foreground for a given background.
- avatar_
pixel_ size - Resolve a discrete
AvatarSizeto a logical-pixel side length using the recipe’s size table.Custom(px)is clamped to at least 1 px. - fnv1a_
64 - FNV-1a 64-bit hash — deterministic palette-bucket selection.
- hash_
pick_ palette_ color - Pick a colour from the theme’s chart palette deterministically
from
seed. Empty palette falls back to a neutral grey so the widget still renders. - paint_
border - Stroke a border ring inside the avatar’s content bounds.
- paint_
focus_ ring - Stroke a focus ring outside the avatar’s content bounds. Hugs the configured shape so a square avatar gets a square ring.