refactor(theme): replace hardcoded colors with Material3 theme-aware composables + adaptive iOS surface color

This commit is contained in:
null 2026-06-23 12:31:59 -05:00
parent e5c13b6b6d
commit 424ef0e4ab
16 changed files with 123 additions and 67 deletions

View File

@ -2,6 +2,9 @@ package app.closer.ui.answers
import app.closer.R
import app.closer.ui.theme.closerBackgroundBrush
import app.closer.ui.theme.closerCardColor
import app.closer.ui.theme.closerSoftPurpleColor
import app.closer.ui.theme.closerSoftSurfaceColor
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
@ -274,14 +277,14 @@ private fun HistoryFilterPill(
.heightIn(min = 44.dp)
.clickable(onClick = onClick),
shape = RoundedCornerShape(999.dp),
color = if (selected) CloserPalette.PurpleMist else Color.White.copy(alpha = 0.74f),
color = if (selected) closerSoftPurpleColor() else closerSoftSurfaceColor(alpha = 0.74f),
shadowElevation = if (selected) 2.dp else 0.dp
) {
Text(
text = "$label $count",
modifier = Modifier.padding(horizontal = 12.dp, vertical = 8.dp),
style = MaterialTheme.typography.labelMedium,
color = if (selected) CloserPalette.PurpleDeep else MaterialTheme.colorScheme.onSurfaceVariant,
color = if (selected) MaterialTheme.colorScheme.onPrimaryContainer else MaterialTheme.colorScheme.onSurfaceVariant,
fontWeight = if (selected) FontWeight.SemiBold else FontWeight.Medium,
maxLines = 1,
overflow = TextOverflow.Ellipsis
@ -301,7 +304,7 @@ private fun AnswerHistoryCard(
onClick = onClick,
modifier = Modifier.fillMaxWidth(),
shape = RoundedCornerShape(24.dp),
colors = CardDefaults.cardColors(containerColor = Color.White),
colors = CardDefaults.cardColors(containerColor = closerCardColor(alpha = 0.94f)),
elevation = CardDefaults.cardElevation(defaultElevation = 6.dp)
) {
Row(
@ -348,7 +351,7 @@ private fun AnswerHistoryCard(
Text(
text = if (answer.isRevealed) "Opened" else "Private",
style = MaterialTheme.typography.labelMedium,
color = Color(0xFF56306F),
color = MaterialTheme.colorScheme.onPrimaryContainer,
fontWeight = FontWeight.SemiBold
)
TextButton(
@ -368,8 +371,8 @@ private fun AnswerHistoryCard(
@Composable
private fun HistoryStateBadge(isRevealed: Boolean) {
val tint = if (isRevealed) CloserPalette.PurpleDeep else CloserPalette.Evergreen
val container = if (isRevealed) CloserPalette.PurpleMist else CloserPalette.Evergreen.copy(alpha = 0.10f)
val tint = if (isRevealed) MaterialTheme.colorScheme.onPrimaryContainer else CloserPalette.Evergreen
val container = if (isRevealed) closerSoftPurpleColor() else CloserPalette.Evergreen.copy(alpha = 0.10f)
Surface(
shape = RoundedCornerShape(999.dp),
color = container
@ -399,7 +402,7 @@ private fun HistoryStateBadge(isRevealed: Boolean) {
private fun HistoryPill(label: String) {
Surface(
shape = RoundedCornerShape(999.dp),
color = Color(0xFFFFF8FC)
color = closerSoftSurfaceColor()
) {
Text(
text = label,

View File

@ -1,6 +1,10 @@
package app.closer.ui.answers
import app.closer.ui.theme.closerBackgroundBrush
import app.closer.ui.theme.closerCardColor
import app.closer.ui.theme.closerSoftPinkColor
import app.closer.ui.theme.closerSoftPurpleColor
import app.closer.ui.theme.closerSoftSurfaceColor
import android.provider.Settings
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.core.tween
@ -655,7 +659,7 @@ private fun TinyActionCard(
Card(
modifier = Modifier.fillMaxWidth(),
shape = RoundedCornerShape(28.dp),
colors = CardDefaults.cardColors(containerColor = Color(0xFFFFF0F8)),
colors = CardDefaults.cardColors(containerColor = closerSoftPinkColor(alpha = 0.84f)),
elevation = CardDefaults.cardElevation(defaultElevation = 4.dp)
) {
Column(
@ -667,7 +671,7 @@ private fun TinyActionCard(
Text(
text = mode.actionCopy,
style = MaterialTheme.typography.bodyMedium.copy(fontWeight = FontWeight.SemiBold),
color = Color(0xFF56306F),
color = MaterialTheme.colorScheme.onSecondaryContainer,
maxLines = 3,
overflow = TextOverflow.Ellipsis
)
@ -698,7 +702,7 @@ private fun FollowUpSection(
Card(
modifier = Modifier.fillMaxWidth(),
shape = RoundedCornerShape(28.dp),
colors = CardDefaults.cardColors(containerColor = Color(0xFFFFF8FC)),
colors = CardDefaults.cardColors(containerColor = closerCardColor(alpha = 0.94f)),
elevation = CardDefaults.cardElevation(defaultElevation = 6.dp)
) {
Column(
@ -710,7 +714,7 @@ private fun FollowUpSection(
Text(
text = "Want to keep the conversation going?",
style = MaterialTheme.typography.titleMedium,
color = Color(0xFF24122F),
color = MaterialTheme.colorScheme.onSurface,
fontWeight = FontWeight.SemiBold,
maxLines = 2,
overflow = TextOverflow.Ellipsis
@ -743,7 +747,7 @@ private fun FollowUpChip(
.heightIn(min = 52.dp)
.clickable(onClick = onClick),
shape = RoundedCornerShape(18.dp),
color = Color.White
color = closerSoftSurfaceColor()
) {
Row(
modifier = Modifier
@ -755,7 +759,7 @@ private fun FollowUpChip(
Text(
text = label,
style = MaterialTheme.typography.bodyLarge,
color = Color(0xFF56306F),
color = MaterialTheme.colorScheme.onPrimaryContainer,
fontWeight = FontWeight.SemiBold,
maxLines = 2,
overflow = TextOverflow.Ellipsis,
@ -776,7 +780,7 @@ private fun RevealMessageCard(content: @Composable () -> Unit) {
Card(
modifier = Modifier.fillMaxWidth(),
shape = RoundedCornerShape(28.dp),
colors = CardDefaults.cardColors(containerColor = Color.White),
colors = CardDefaults.cardColors(containerColor = closerCardColor(alpha = 0.94f)),
elevation = CardDefaults.cardElevation(defaultElevation = 10.dp)
) {
Box(modifier = Modifier.padding(20.dp)) {
@ -813,7 +817,7 @@ private fun AnswerPreview(
Surface(
modifier = Modifier.fillMaxWidth(),
shape = RoundedCornerShape(20.dp),
color = if (revealed) Color(0xFFF4E8FF) else Color(0xFFFFF8FC)
color = if (revealed) closerSoftPurpleColor() else closerSoftSurfaceColor()
) {
Column(
modifier = Modifier.padding(16.dp),
@ -822,13 +826,13 @@ private fun AnswerPreview(
Text(
text = if (revealed) "Opened answer" else "Private preview",
style = MaterialTheme.typography.labelMedium,
color = Color(0xFF56306F),
color = MaterialTheme.colorScheme.onPrimaryContainer,
fontWeight = FontWeight.SemiBold
)
Text(
text = if (revealed) answer.revealSummary() else answer.privatePreview(),
style = MaterialTheme.typography.bodyLarge,
color = Color(0xFF3E3346),
color = MaterialTheme.colorScheme.onSurface,
maxLines = 6,
overflow = TextOverflow.Ellipsis
)
@ -840,7 +844,7 @@ private fun AnswerPreview(
private fun RevealPill(label: String) {
Surface(
shape = RoundedCornerShape(999.dp),
color = Color(0xFFFFF8FC),
color = closerSoftSurfaceColor(),
modifier = Modifier.heightIn(min = 32.dp)
) {
Text(
@ -868,7 +872,7 @@ private fun PartnerAnswerPreview(answer: LocalAnswer) {
Surface(
modifier = Modifier.fillMaxWidth(),
shape = RoundedCornerShape(20.dp),
color = Color(0xFFE8F4FF)
color = MaterialTheme.colorScheme.tertiaryContainer.copy(alpha = 0.78f)
) {
Column(
modifier = Modifier.padding(16.dp),
@ -877,13 +881,13 @@ private fun PartnerAnswerPreview(answer: LocalAnswer) {
Text(
text = "Your partner answered",
style = MaterialTheme.typography.labelMedium,
color = Color(0xFF30566F),
color = MaterialTheme.colorScheme.onTertiaryContainer,
fontWeight = FontWeight.SemiBold
)
Text(
text = answer.partnerRevealSummary(),
style = MaterialTheme.typography.bodyLarge,
color = Color(0xFF33463E),
color = MaterialTheme.colorScheme.onSurface,
maxLines = 6,
overflow = TextOverflow.Ellipsis
)
@ -896,7 +900,7 @@ private fun WaitingForPartnerCard() {
Surface(
modifier = Modifier.fillMaxWidth(),
shape = RoundedCornerShape(20.dp),
color = Color.White.copy(alpha = 0.60f)
color = closerSoftSurfaceColor(alpha = 0.60f)
) {
Column(
modifier = Modifier.padding(16.dp),
@ -905,7 +909,7 @@ private fun WaitingForPartnerCard() {
Text(
text = "Partner answer",
style = MaterialTheme.typography.labelMedium,
color = Color(0xFF56306F),
color = MaterialTheme.colorScheme.onPrimaryContainer,
fontWeight = FontWeight.SemiBold
)
Text(

View File

@ -1,6 +1,7 @@
package app.closer.ui.components
import app.closer.ui.theme.closerBackgroundBrush
import app.closer.ui.theme.closerSoftSurfaceColor
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.background
import androidx.compose.foundation.border
@ -300,7 +301,7 @@ private fun DetailRow(
modifier = Modifier
.fillMaxWidth()
.clip(RoundedCornerShape(18.dp))
.background(Color(0xFFFFF8FC))
.background(closerSoftSurfaceColor())
.padding(14.dp),
verticalAlignment = Alignment.CenterVertically
) {

View File

@ -1,5 +1,7 @@
package app.closer.ui.components
import app.closer.ui.theme.closerCardColor
import app.closer.ui.theme.closerSoftPurpleColor
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
@ -41,7 +43,7 @@ fun SpecialDatesSection(
Card(
modifier = modifier.fillMaxWidth(),
shape = RoundedCornerShape(if (compact) 24.dp else 28.dp),
colors = CardDefaults.cardColors(containerColor = Color.White),
colors = CardDefaults.cardColors(containerColor = closerCardColor(alpha = 0.94f)),
elevation = CardDefaults.cardElevation(defaultElevation = if (compact) 4.dp else 8.dp)
) {
Column(
@ -66,7 +68,7 @@ fun SpecialDatesSection(
// Anniversary featured card
Surface(
shape = RoundedCornerShape(20.dp),
color = PurpleLight,
color = closerSoftPurpleColor(),
modifier = Modifier.fillMaxWidth()
) {
Row(

View File

@ -2,6 +2,7 @@ package app.closer.ui.dates
import app.closer.ui.theme.closerCardColor
import app.closer.ui.theme.closerBackgroundBrush
import app.closer.ui.theme.closerSoftSurfaceColor
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
@ -283,7 +284,7 @@ private fun DateTimeField(
Column(
modifier = modifier
.clickable(onClick = onClick)
.background(Color(0xFFFFF8FC), RoundedCornerShape(16.dp))
.background(closerSoftSurfaceColor(), RoundedCornerShape(16.dp))
.padding(16.dp),
verticalArrangement = Arrangement.spacedBy(6.dp)
) {
@ -399,7 +400,7 @@ private fun DurationChip(
) {
Surface(
shape = RoundedCornerShape(999.dp),
color = if (selected) Color(0xFFB98AF4) else Color(0xFFFFF8FC),
color = if (selected) MaterialTheme.colorScheme.primary else closerSoftSurfaceColor(),
tonalElevation = if (selected) 0.dp else 2.dp,
shadowElevation = if (selected) 0.dp else 2.dp,
modifier = modifier

View File

@ -1,6 +1,10 @@
package app.closer.ui.dates
import app.closer.ui.theme.closerBackgroundBrush
import app.closer.ui.theme.closerCardColor
import app.closer.ui.theme.closerSoftPinkColor
import app.closer.ui.theme.closerSoftPurpleColor
import app.closer.ui.theme.closerSoftSurfaceColor
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.spring
import androidx.compose.foundation.background
@ -330,7 +334,7 @@ private fun DateCard(
modifier = modifier,
shape = RoundedCornerShape(32.dp),
colors = CardDefaults.cardColors(
containerColor = Color.White.copy(alpha = if (dimmed) 0.7f else 0.96f)
containerColor = closerCardColor(alpha = if (dimmed) 0.70f else 0.96f)
),
elevation = CardDefaults.cardElevation(defaultElevation = if (dimmed) 1.dp else 6.dp)
) {
@ -385,7 +389,7 @@ private fun DateCard(
private fun PremiumBadge() {
Surface(
shape = RoundedCornerShape(999.dp),
color = Color(0xFFFFD8EB)
color = closerSoftPinkColor()
) {
Row(
modifier = Modifier.padding(horizontal = 10.dp, vertical = 6.dp),
@ -396,12 +400,12 @@ private fun PremiumBadge() {
imageVector = Icons.Filled.Star,
contentDescription = null,
modifier = Modifier.size(14.dp),
tint = Color(0xFF8A226F)
tint = MaterialTheme.colorScheme.onSecondaryContainer
)
Text(
text = "Premium",
style = MaterialTheme.typography.labelSmall,
color = Color(0xFF8A226F),
color = MaterialTheme.colorScheme.onSecondaryContainer,
fontWeight = FontWeight.SemiBold
)
}
@ -412,13 +416,13 @@ private fun PremiumBadge() {
private fun CategoryPill(label: String) {
Surface(
shape = RoundedCornerShape(999.dp),
color = Color(0xFFF3E8FF)
color = closerSoftPurpleColor()
) {
Text(
text = label,
modifier = Modifier.padding(horizontal = 12.dp, vertical = 7.dp),
style = MaterialTheme.typography.labelMedium,
color = Color(0xFF56306F),
color = MaterialTheme.colorScheme.onPrimaryContainer,
fontWeight = FontWeight.SemiBold,
maxLines = 1,
overflow = TextOverflow.Ellipsis
@ -430,7 +434,7 @@ private fun CategoryPill(label: String) {
private fun InfoChip(label: String) {
Surface(
shape = RoundedCornerShape(12.dp),
color = Color(0xFFFFF8FC)
color = closerSoftSurfaceColor()
) {
Text(
text = label,
@ -457,14 +461,14 @@ private fun ActionButtons(
CircularActionButton(
icon = Icons.Filled.Close,
contentDescription = "Skip",
color = Color(0xFFFFE5E7),
color = MaterialTheme.colorScheme.errorContainer,
iconColor = Color(0xFF8D2D35),
onClick = onSkip
)
CircularActionButton(
icon = Icons.Filled.Star,
contentDescription = "Maybe",
color = Color(0xFFFFF8E1),
color = MaterialTheme.colorScheme.tertiaryContainer.copy(alpha = 0.74f),
iconColor = Color(0xFF6B5D00),
onClick = onMaybe,
size = 72.dp
@ -472,7 +476,7 @@ private fun ActionButtons(
CircularActionButton(
icon = Icons.Filled.Favorite,
contentDescription = "Love",
color = Color(0xFFFFE3F0),
color = closerSoftPinkColor(),
iconColor = Color(0xFF9B1B5A),
onClick = onLove
)
@ -528,7 +532,7 @@ private fun MatchOverlay(
) {
Card(
shape = RoundedCornerShape(28.dp),
colors = CardDefaults.cardColors(containerColor = Color.White)
colors = CardDefaults.cardColors(containerColor = closerCardColor(alpha = 0.96f))
) {
Column(
modifier = Modifier.padding(28.dp),
@ -537,7 +541,7 @@ private fun MatchOverlay(
) {
Surface(
shape = CircleShape,
color = Color(0xFFFFE3F0),
color = closerSoftPinkColor(),
modifier = Modifier.size(72.dp)
) {
Box(contentAlignment = Alignment.Center) {

View File

@ -2,6 +2,9 @@ package app.closer.ui.dates
import app.closer.ui.theme.closerCardColor
import app.closer.ui.theme.closerBackgroundBrush
import app.closer.ui.theme.closerSoftPinkColor
import app.closer.ui.theme.closerSoftPurpleColor
import app.closer.ui.theme.closerSoftSurfaceColor
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
@ -203,7 +206,7 @@ private fun SectionHeader(
}
Surface(
shape = RoundedCornerShape(999.dp),
color = Color(0xFFFFF8FC)
color = closerSoftSurfaceColor()
) {
Text(
text = count.toString(),
@ -223,7 +226,7 @@ private fun MatchCard(match: DateMatch) {
badge = {
Surface(
shape = RoundedCornerShape(999.dp),
color = Color(0xFFFFE3F0)
color = closerSoftPinkColor()
) {
Row(
modifier = Modifier.padding(horizontal = 10.dp, vertical = 6.dp),
@ -255,7 +258,7 @@ private fun SuggestionCard(suggestion: DateMatchSuggestion) {
badge = {
Surface(
shape = RoundedCornerShape(999.dp),
color = Color(0xFFFFF8E1)
color = MaterialTheme.colorScheme.tertiaryContainer.copy(alpha = 0.74f)
) {
Row(
modifier = Modifier.padding(horizontal = 10.dp, vertical = 6.dp),
@ -304,13 +307,13 @@ private fun IdeaCard(
) {
Surface(
shape = RoundedCornerShape(999.dp),
color = Color(0xFFF3E8FF)
color = closerSoftPurpleColor()
) {
Text(
text = idea.category.displayDateCategory(),
modifier = Modifier.padding(horizontal = 11.dp, vertical = 7.dp),
style = MaterialTheme.typography.labelMedium,
color = Color(0xFF56306F),
color = MaterialTheme.colorScheme.onPrimaryContainer,
fontWeight = FontWeight.SemiBold,
maxLines = 1,
overflow = TextOverflow.Ellipsis
@ -356,13 +359,13 @@ private fun InfoChip(
) {
Surface(
shape = RoundedCornerShape(12.dp),
color = if (emphasis) Color(0xFFFFD8EB) else Color(0xFFFFF8FC)
color = if (emphasis) closerSoftPinkColor() else closerSoftSurfaceColor()
) {
Text(
text = label,
modifier = Modifier.padding(horizontal = 10.dp, vertical = 6.dp),
style = MaterialTheme.typography.labelMedium,
color = if (emphasis) Color(0xFF8A226F) else MaterialTheme.colorScheme.onSurfaceVariant,
color = if (emphasis) MaterialTheme.colorScheme.onSecondaryContainer else MaterialTheme.colorScheme.onSurfaceVariant,
fontWeight = if (emphasis) FontWeight.SemiBold else FontWeight.Medium
)
}

View File

@ -2,6 +2,7 @@ package app.closer.ui.paywall
import app.closer.ui.theme.closerCardColor
import app.closer.ui.theme.closerBackgroundBrush
import app.closer.ui.theme.closerSoftSurfaceColor
import android.app.Activity
import android.content.Context
import android.content.ContextWrapper
@ -390,7 +391,7 @@ private fun ActionButtons(
Card(
modifier = Modifier.fillMaxWidth(),
shape = RoundedCornerShape(16.dp),
colors = CardDefaults.cardColors(containerColor = Color.White.copy(alpha = 0.54f)),
colors = CardDefaults.cardColors(containerColor = closerSoftSurfaceColor(alpha = 0.54f)),
elevation = CardDefaults.cardElevation(0.dp)
) {
Row(

View File

@ -2,6 +2,8 @@ package app.closer.ui.questions
import app.closer.ui.theme.closerCardColor
import app.closer.ui.theme.closerBackgroundBrush
import app.closer.ui.theme.closerSoftPurpleColor
import app.closer.ui.theme.closerSoftSurfaceColor
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.horizontalScroll
@ -285,14 +287,14 @@ private fun CategoryPill(
) {
Surface(
shape = RoundedCornerShape(999.dp),
color = if (emphasis) Color(0xFFF3E8FF) else Color(0xFFFFF8FC),
color = if (emphasis) closerSoftPurpleColor() else closerSoftSurfaceColor(),
modifier = Modifier.heightIn(min = 32.dp)
) {
Text(
text = label,
modifier = Modifier.padding(horizontal = 11.dp, vertical = 7.dp),
style = MaterialTheme.typography.labelMedium,
color = if (emphasis) Color(0xFF56306F) else MaterialTheme.colorScheme.onSurface,
color = if (emphasis) MaterialTheme.colorScheme.onPrimaryContainer else MaterialTheme.colorScheme.onSurface,
maxLines = 1,
overflow = TextOverflow.Ellipsis
)

View File

@ -2,6 +2,8 @@ package app.closer.ui.questions
import app.closer.ui.theme.closerCardColor
import app.closer.ui.theme.closerBackgroundBrush
import app.closer.ui.theme.closerSoftPurpleColor
import app.closer.ui.theme.closerSoftSurfaceColor
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
@ -200,10 +202,7 @@ private fun QuestionPackCard(
item: QuestionPackItem,
onClick: () -> Unit
) {
val containerColor = if (item.isLocked)
Color(0xFFFFF8FC).copy(alpha = 0.9f)
else
closerCardColor(alpha = 0.9f)
val containerColor = if (item.isLocked) closerSoftSurfaceColor(alpha = 0.9f) else closerCardColor(alpha = 0.9f)
val accent = packAccent(item.category.id)
Card(
@ -231,7 +230,7 @@ private fun QuestionPackCard(
.align(Alignment.BottomStart)
.fillMaxWidth()
.height(5.dp)
.background(if (item.isLocked) Color(0xFFE3D4EB) else accent)
.background(if (item.isLocked) MaterialTheme.colorScheme.outlineVariant else accent)
)
}
Column(
@ -321,7 +320,7 @@ private fun FilterPill(
.heightIn(min = 44.dp)
.clickable(onClick = onClick),
shape = RoundedCornerShape(999.dp),
color = if (selected) Color(0xFFF3E8FF) else Color.White.copy(alpha = 0.74f),
color = if (selected) closerSoftPurpleColor() else closerSoftSurfaceColor(alpha = 0.74f),
tonalElevation = 0.dp,
shadowElevation = if (selected) 3.dp else 0.dp
) {
@ -329,7 +328,7 @@ private fun FilterPill(
text = label,
modifier = Modifier.padding(horizontal = 13.dp, vertical = 8.dp),
style = MaterialTheme.typography.labelMedium,
color = if (selected) Color(0xFF56306F) else MaterialTheme.colorScheme.onSurface,
color = if (selected) MaterialTheme.colorScheme.onPrimaryContainer else MaterialTheme.colorScheme.onSurface,
fontWeight = if (selected) FontWeight.SemiBold else FontWeight.Medium,
maxLines = 1,
overflow = TextOverflow.Ellipsis
@ -344,14 +343,14 @@ private fun PackPill(
) {
Surface(
shape = RoundedCornerShape(999.dp),
color = if (emphasis) Color(0xFFF3E8FF) else Color(0xFFFFF8FC),
color = if (emphasis) closerSoftPurpleColor() else closerSoftSurfaceColor(),
modifier = Modifier.heightIn(min = 32.dp)
) {
Text(
text = label,
modifier = Modifier.padding(horizontal = 11.dp, vertical = 7.dp),
style = MaterialTheme.typography.labelMedium,
color = if (emphasis) Color(0xFF56306F) else MaterialTheme.colorScheme.onSurface,
color = if (emphasis) MaterialTheme.colorScheme.onPrimaryContainer else MaterialTheme.colorScheme.onSurface,
maxLines = 1,
overflow = TextOverflow.Ellipsis
)

View File

@ -17,6 +17,7 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import app.closer.domain.model.Question
import app.closer.ui.theme.closerCardColor
@Composable
fun QuestionHeader(
@ -31,7 +32,7 @@ fun QuestionHeader(
modifier = Modifier.fillMaxWidth(),
shape = RoundedCornerShape(26.dp),
colors = CardDefaults.cardColors(
containerColor = Color(0xFFFFF8FC).copy(alpha = 0.94f)
containerColor = closerCardColor(alpha = 0.94f)
),
elevation = CardDefaults.cardElevation(defaultElevation = 5.dp)
) {

View File

@ -314,7 +314,7 @@ fun SettingsScreen(
onClick = { onNavigate(AppRoute.ACCOUNT) },
modifier = Modifier.fillMaxWidth(),
shape = RoundedCornerShape(22.dp),
colors = CardDefaults.cardColors(containerColor = Color(0xFFFFF8FC).copy(alpha = 0.96f)),
colors = CardDefaults.cardColors(containerColor = SettingsCard.copy(alpha = 0.96f)),
elevation = CardDefaults.cardElevation(defaultElevation = 5.dp)
) {
Row(
@ -366,7 +366,7 @@ fun SettingsScreen(
},
modifier = Modifier.fillMaxWidth(),
shape = RoundedCornerShape(22.dp),
colors = CardDefaults.cardColors(containerColor = Color(0xFFF8F0FF).copy(alpha = 0.96f)),
colors = CardDefaults.cardColors(containerColor = SettingsSoft.copy(alpha = 0.52f)),
elevation = CardDefaults.cardElevation(defaultElevation = 5.dp)
) {
Row(

View File

@ -1,6 +1,7 @@
package app.closer.ui.theme
import androidx.compose.material3.MaterialTheme
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Brush
@ -59,6 +60,30 @@ fun closerElevatedCardColor(): Color = closerCardColor(alpha = 0.92f)
@Composable
fun closerSolidCardColor(): Color = MaterialTheme.colorScheme.surface
@Composable
fun closerSoftSurfaceColor(alpha: Float = 0.92f): Color =
if (isSystemInDarkTheme()) {
MaterialTheme.colorScheme.surfaceVariant.copy(alpha = alpha)
} else {
Color.White.copy(alpha = alpha)
}
@Composable
fun closerSoftPurpleColor(alpha: Float = 1f): Color =
if (isSystemInDarkTheme()) {
MaterialTheme.colorScheme.primaryContainer.copy(alpha = alpha)
} else {
CloserPalette.PurpleMist.copy(alpha = alpha)
}
@Composable
fun closerSoftPinkColor(alpha: Float = 1f): Color =
if (isSystemInDarkTheme()) {
MaterialTheme.colorScheme.secondaryContainer.copy(alpha = alpha)
} else {
CloserPalette.PinkMist.copy(alpha = alpha)
}
@Composable
fun closerScrimColor(alpha: Float = 0.54f): Color =
MaterialTheme.colorScheme.onSurface.copy(alpha = alpha)

View File

@ -2,6 +2,7 @@ package app.closer.ui.wheel
import app.closer.ui.theme.closerCardColor
import app.closer.ui.theme.closerBackgroundBrush
import app.closer.ui.theme.closerSoftPurpleColor
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
@ -137,14 +138,14 @@ private fun WheelSessionContent(
if (state.categoryName.isNotBlank()) {
Surface(
shape = RoundedCornerShape(999.dp),
color = Color(0xFFF0EDF9),
color = closerSoftPurpleColor(),
modifier = Modifier.heightIn(min = 32.dp)
) {
Text(
text = state.categoryName,
modifier = Modifier.padding(horizontal = 12.dp, vertical = 6.dp),
style = MaterialTheme.typography.labelMedium,
color = Color(0xFF56306F),
color = MaterialTheme.colorScheme.onPrimaryContainer,
maxLines = 1,
overflow = TextOverflow.Ellipsis
)
@ -163,8 +164,8 @@ private fun WheelSessionContent(
LinearProgressIndicator(
progress = { progress },
modifier = Modifier.fillMaxWidth(),
color = Color(0xFF56306F),
trackColor = Color(0xFFF4E8FF)
color = MaterialTheme.colorScheme.primary,
trackColor = MaterialTheme.colorScheme.primaryContainer
)
// Question card

View File

@ -877,7 +877,7 @@ struct SettingsSectionCard<Content: View>: View {
VStack(spacing: 0) {
content
}
.background(Color.white.opacity(0.58))
.background(Color.closerSurface.opacity(0.72))
.clipShape(RoundedRectangle(cornerRadius: CloserRadius.large, style: .continuous))
}
.padding(CloserSpacing.md)

View File

@ -1,12 +1,19 @@
import SwiftUI
#if canImport(UIKit)
import UIKit
#endif
// MARK: - Theme
extension Color {
private static func adaptive(light: String, dark: String) -> Color {
#if canImport(UIKit)
Color(UIColor { traitCollection in
UIColor(hex: traitCollection.userInterfaceStyle == .dark ? dark : light)
})
#else
Color(hex: light)
#endif
}
// Primary palette
@ -59,6 +66,7 @@ extension Color {
}
}
#if canImport(UIKit)
private extension UIColor {
convenience init(hex: String) {
let hex = hex.trimmingCharacters(in: CharacterSet.alphanumerics.inverted)
@ -81,6 +89,7 @@ private extension UIColor {
)
}
}
#endif
// MARK: - Typography