From 379f84a4aeb86ace5b1cb9fcac084915d8868146 Mon Sep 17 00:00:00 2001 From: another-simple-pixel Date: Mon, 18 May 2026 07:46:12 -0700 Subject: [PATCH] ProfileImage colors: split into card vs canvas variants MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../common/views/chat/group/GroupMemberInfoView.kt | 2 +- .../simplex/common/views/helpers/ChatInfoImage.kt | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/group/GroupMemberInfoView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/group/GroupMemberInfoView.kt index 1dd23a66d4..eb3ba1f8be 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/group/GroupMemberInfoView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/group/GroupMemberInfoView.kt @@ -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 ) { diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/ChatInfoImage.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/ChatInfoImage.kt index 94ffc10087..959cb53089 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/ChatInfoImage.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/ChatInfoImage.kt @@ -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