resolveTextAvatarSeedColor function
Implementation
Color resolveTextAvatarSeedColor(
String text,
String initials, {
Color? baseColor,
Map<String, Color>? includeColor,
Map<String, Color> palette = textAvatarColorData,
}) {
if (baseColor != null) return baseColor;
final paletteMap = includeColor.updateAndJoin(palette);
final keySource = initials.isNotEmpty ? initials : text.trim();
if (keySource.isEmptyOrNull) return Colors.grey;
final key = _firstAlphabet(keySource).toLowerCase();
if (key.isEmpty) return textAvatarHashColor(text);
return paletteMap[key] ?? textAvatarHashColor(text);
}