mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-05-26 05:24:43 +00:00
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:
+1
-1
@@ -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
|
||||
) {
|
||||
|
||||
+13
-1
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user