ProfileImage colors: split into card vs canvas variants

Revert defaultProfileIconColor back to 0.91 mix (~#E8) — that's the right
amount of contrast against a white SectionView card. Add a sibling helper
defaultProfileIconColorOnCanvas() at 0.85 mix (~#D9), which sits 23 units
below the ~#F0 canvas — same absolute contrast as the card variant achieves
on white.

Switch MemberProfileImage default from defaultProfileIconColor to the canvas
variant. Member avatars almost always render on canvas (chat list rows,
chat-bubble author avatar, group members list outside the card, channel
members, channel relays). Callers that need the card variant pass an
explicit color.
This commit is contained in:
another-simple-pixel
2026-05-18 07:46:12 -07:00
parent bea3f24664
commit 379f84a4ae
2 changed files with 14 additions and 2 deletions
@@ -895,7 +895,7 @@ private fun RoleSelectionRow(
fun MemberProfileImage(
size: Dp,
mem: GroupMember,
color: Color = defaultProfileIconColor(),
color: Color = defaultProfileIconColorOnCanvas(),
backgroundColor: Color? = null,
async: Boolean = false
) {
@@ -25,9 +25,21 @@ import dev.icerock.moko.resources.ImageResource
import kotlin.math.max
@Composable
// Default placeholder color for avatars rendered against a SectionView card
// (white on LIGHT). 0.91 mix lands ~#E8, sitting 23 units below the white card —
// visible without dominating.
fun defaultProfileIconColor(): Color =
if (CurrentColors.value.base == DefaultTheme.LIGHT)
MaterialTheme.colors.background.mixWith(MaterialTheme.colors.onBackground, 0.97f)
MaterialTheme.colors.background.mixWith(MaterialTheme.colors.onBackground, 0.91f)
else
MaterialTheme.colors.secondaryVariant
// Variant for avatars rendered directly on the off-white canvas (chat list,
// members list outside a card). 0.85 mix lands ~#D9, sitting 23 units below
// the ~#F0 canvas — same absolute contrast as the card variant achieves on white.
fun defaultProfileIconColorOnCanvas(): Color =
if (CurrentColors.value.base == DefaultTheme.LIGHT)
MaterialTheme.colors.background.mixWith(MaterialTheme.colors.onBackground, 0.85f)
else
MaterialTheme.colors.secondaryVariant