shared/theme/avatar_color library
Deterministic avatar colour derived from a seed string. Single source of truth so every surface renders the same contact with the same colour.
Divergence from the Mostpost source (app-frame spec §1): the seed is
a STABLE CONTACT IDENTIFIER (contact id / fingerprint display string
— fixed when Messaging UX lands), never an email and never a PII
requirement; Mostpost's multi-inbox accountDotColorFor is dropped
(a mail affordance).
Functions
-
avatarColorFor(
String seed, WalletColors colors) → Color -
Picks a deterministic colour from the palette. Falls back to
WalletColors.textMuted when
seedis empty (renders as a neutral avatar rather than throwing on missing data).