diff --git a/app/src/main/java/com/example/hackathon/presentation/navigation/BottomNavBar.kt b/app/src/main/java/com/example/hackathon/presentation/navigation/BottomNavBar.kt index ebe4249..b197f44 100644 --- a/app/src/main/java/com/example/hackathon/presentation/navigation/BottomNavBar.kt +++ b/app/src/main/java/com/example/hackathon/presentation/navigation/BottomNavBar.kt @@ -18,6 +18,8 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp +import com.example.hackathon.core.designsystem.theme.Gray400 +import com.example.hackathon.core.designsystem.theme.Gray500 import com.example.hackathon.core.designsystem.theme.HackathonTheme import com.example.hackathon.core.designsystem.util.noRippleClickable import kotlin.enums.EnumEntries @@ -74,7 +76,7 @@ fun BottomNavBar( if (isSelected) { HackathonTheme.colors.black } else { - Color(0xFF8B91A1) + HackathonTheme.colors.iconUnselected } ) Text( @@ -84,7 +86,7 @@ fun BottomNavBar( if (isSelected) { HackathonTheme.colors.black } else { - Color(0xFF939DA9) + HackathonTheme.colors.labelUnselected } ) } diff --git a/core/designsystem/src/main/java/com/example/hackathon/core/designsystem/component/CombinationCard.kt b/core/designsystem/src/main/java/com/example/hackathon/core/designsystem/component/CombinationCard.kt index af3ef98..5b2c7c3 100644 --- a/core/designsystem/src/main/java/com/example/hackathon/core/designsystem/component/CombinationCard.kt +++ b/core/designsystem/src/main/java/com/example/hackathon/core/designsystem/component/CombinationCard.kt @@ -3,10 +3,18 @@ package com.example.hackathon.core.designsystem.component import androidx.compose.foundation.background import androidx.compose.foundation.border import androidx.compose.foundation.clickable -import androidx.compose.foundation.layout.* +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.FlowRow +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.RoundedCornerShape -import com.example.hackathon.core.designsystem.icon.HackathonIcons import androidx.compose.material3.Card import androidx.compose.material3.CardDefaults import androidx.compose.material3.HorizontalDivider @@ -17,8 +25,6 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.drawBehind -import androidx.compose.ui.draw.shadow -import androidx.compose.ui.graphics.Brush import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Paint import androidx.compose.ui.graphics.drawscope.drawIntoCanvas @@ -28,6 +34,7 @@ import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import coil3.compose.AsyncImage +import com.example.hackathon.core.designsystem.icon.HackathonIcons import com.example.hackathon.core.designsystem.theme.Gray50 import com.example.hackathon.core.designsystem.theme.Gray700 import com.example.hackathon.core.designsystem.theme.HackathonTheme @@ -204,7 +211,7 @@ fun CombinationCard( Text( text = combination.description, style = HackathonTheme.typography.Body_medium, - color = Color(0xFFC0C0C0), + color = HackathonTheme.colors.onSurfaceVariant, maxLines = 2, overflow = TextOverflow.Ellipsis ) @@ -212,7 +219,7 @@ fun CombinationCard( HorizontalDivider( thickness = 0.5.dp, - color = Color(0xFFC0C0C0) + color = HackathonTheme.colors.onSurfaceVariant ) Spacer(modifier = Modifier.height(12.dp)) diff --git a/core/designsystem/src/main/java/com/example/hackathon/core/designsystem/theme/Color.kt b/core/designsystem/src/main/java/com/example/hackathon/core/designsystem/theme/Color.kt index 674de18..d6f78a3 100644 --- a/core/designsystem/src/main/java/com/example/hackathon/core/designsystem/theme/Color.kt +++ b/core/designsystem/src/main/java/com/example/hackathon/core/designsystem/theme/Color.kt @@ -6,7 +6,6 @@ import androidx.compose.ui.graphics.Color // Figma Design System Colors // Primary Colors val Primary = Color(0xFFE10818) // 빨간색 (Figma Primary) -val PrimaryDark = Color(0xFFC10714) // Neutral Colors (Figma Design System) val Black = Color(0xFF000000) @@ -15,28 +14,23 @@ val Gray50 = Color(0xFFE0DCDC) val Gray700 = Color(0xFF383838) val Gray900 = Color(0xFF202020) +// 추가 그레이/표면 토큰 — 화면에 하드코딩돼 있던 Color(0xFF...) 정리 (#31) +val Gray200 = Color(0xFFCCCCCC) +val Gray300 = Color(0xFFC0C0C0) +val Gray400 = Color(0xFF939DA9) +val Gray500 = Color(0xFF8B91A1) +val Gray600 = Color(0xFF555555) +val SurfaceVariant = Color(0xFFF7F7F7) +val PrimaryContainer = Color(0xFFFFF3F3) + // Background Colors val Background = Color(0xFFFFFFFF) // White background val Surface = Color(0xFFFFFFFF) -// Text Colors -val TextPrimary = Color(0xFF000000) // Black -val TextSecondary = Color(0xFF383838) // Gray700 - // Accent Colors val Success = Color(0xFF2ECC71) val Error = Color(0xFFE10818) // Primary red for errors -// Legacy colors (for compatibility - deprecated) -val Secondary = Color(0xFF1F2A44) -val SecondaryLight = Color(0xFF2A3A5A) -val Purple80 = Color(0xFFD0BCFF) -val PurpleGrey80 = Color(0xFFCCC2DC) -val Pink80 = Color(0xFFEFB8C8) -val Purple40 = Color(0xFF6650a4) -val PurpleGrey40 = Color(0xFF625b71) -val Pink40 = Color(0xFF7D5260) - data class HackathonColors( val primary: Color, val black: Color, @@ -47,7 +41,15 @@ data class HackathonColors( val background: Color, val surface: Color, val success: Color, - val error: Color + val error: Color, + // #31 — 화면 하드코딩 색을 역할 기반 토큰으로 추가 (다크모드 도입 대비, 라이트/다크 공통 역할) + val iconUnselected: Color, + val labelUnselected: Color, + val onSurfaceVariant: Color, + val outline: Color, + val textSecondary: Color, + val surfaceVariant: Color, + val primaryContainer: Color ) val defaultHackathonColors = @@ -61,7 +63,14 @@ val defaultHackathonColors = background = Background, surface = Surface, success = Success, - error = Error + error = Error, + iconUnselected = Gray500, + labelUnselected = Gray400, + onSurfaceVariant = Gray300, + outline = Gray200, + textSecondary = Gray600, + surfaceVariant = SurfaceVariant, + primaryContainer = PrimaryContainer ) val LocalHackathonColors = staticCompositionLocalOf { defaultHackathonColors } diff --git a/feature/auth/src/main/java/com/example/hackathon/feature/auth/LoginScreen.kt b/feature/auth/src/main/java/com/example/hackathon/feature/auth/LoginScreen.kt index f143347..12a707e 100644 --- a/feature/auth/src/main/java/com/example/hackathon/feature/auth/LoginScreen.kt +++ b/feature/auth/src/main/java/com/example/hackathon/feature/auth/LoginScreen.kt @@ -121,7 +121,7 @@ fun LoginScreen( lineHeight = 16.sp, style = HackathonTheme.typography.Body_semibold, fontWeight = FontWeight(500), - color = Color(0xFF000000), + color = HackathonTheme.colors.black, textAlign = TextAlign.End ) } diff --git a/feature/combination/src/main/java/com/example/hackathon/feature/combination/DetailScreen.kt b/feature/combination/src/main/java/com/example/hackathon/feature/combination/DetailScreen.kt index 47d6092..5b02f19 100644 --- a/feature/combination/src/main/java/com/example/hackathon/feature/combination/DetailScreen.kt +++ b/feature/combination/src/main/java/com/example/hackathon/feature/combination/DetailScreen.kt @@ -34,7 +34,6 @@ import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip -import androidx.compose.ui.draw.shadow import androidx.compose.ui.graphics.Brush import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.ContentScale @@ -49,7 +48,6 @@ import com.example.hackathon.core.designsystem.icon.HackathonIcons import com.example.hackathon.core.designsystem.theme.HackathonTheme import com.example.hackathon.core.designsystem.theme.Primary import com.example.hackathon.core.model.DummyData -import com.example.hackathon.feature.combination.DetailViewModel @OptIn(ExperimentalMaterial3Api::class) @Composable @@ -259,7 +257,7 @@ fun DetailScreen( Text( text = authorText, style = HackathonTheme.typography.Body_medium, - color = Color(0xFF555555), + color = HackathonTheme.colors.textSecondary, modifier = Modifier.padding(bottom = 10.dp) ) @@ -318,11 +316,11 @@ fun DetailScreen( Modifier .fillMaxWidth() .background( - Color(0xFFF7F7F7), + HackathonTheme.colors.surfaceVariant, shape = RoundedCornerShape(10.dp) ).border( shape = RoundedCornerShape(10.dp), - color = Color(0xFFCCCCCC), + color = HackathonTheme.colors.outline, width = 1.dp ).padding(horizontal = 20.dp, vertical = 15.dp) ) { diff --git a/feature/combination/src/main/java/com/example/hackathon/feature/combination/component/ImageUploadSection.kt b/feature/combination/src/main/java/com/example/hackathon/feature/combination/component/ImageUploadSection.kt index 14b7271..774466e 100644 --- a/feature/combination/src/main/java/com/example/hackathon/feature/combination/component/ImageUploadSection.kt +++ b/feature/combination/src/main/java/com/example/hackathon/feature/combination/component/ImageUploadSection.kt @@ -15,7 +15,6 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape -import com.example.hackathon.core.designsystem.icon.HackathonIcons import androidx.compose.material3.Icon import androidx.compose.material3.IconButton import androidx.compose.material3.MaterialTheme @@ -27,7 +26,6 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.drawBehind import androidx.compose.ui.geometry.CornerRadius import androidx.compose.ui.graphics.Color -import androidx.compose.ui.graphics.PaintingStyle.Companion.Stroke import androidx.compose.ui.graphics.PathEffect import androidx.compose.ui.graphics.drawscope.Stroke import androidx.compose.ui.layout.ContentScale @@ -36,6 +34,7 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import coil3.compose.AsyncImage import com.example.hackathon.core.designsystem.R +import com.example.hackathon.core.designsystem.icon.HackathonIcons import com.example.hackathon.core.designsystem.theme.Gray50 import com.example.hackathon.core.designsystem.theme.Gray700 import com.example.hackathon.core.designsystem.theme.HackathonTheme @@ -47,6 +46,9 @@ fun ImageUploadSection( onRemoveImage: (Uri) -> Unit, modifier: Modifier = Modifier ) { + // drawBehind 는 비-Composable(DrawScope)이라 @Composable 게터인 HackathonTheme.colors 를 직접 못 쓴다. + // 색을 Composable 본문에서 미리 읽어 호이스팅한다. + val primaryColor = HackathonTheme.colors.primary Column( modifier = modifier, verticalArrangement = Arrangement.spacedBy(8.dp) @@ -64,7 +66,7 @@ fun ImageUploadSection( val dashGap = 6.dp.toPx() drawRoundRect( - color = Color(0xFFE10818).copy(alpha = 0.3f), + color = primaryColor.copy(alpha = 0.3f), style = Stroke( width = strokeWidth, @@ -76,7 +78,7 @@ fun ImageUploadSection( cornerRadius = CornerRadius(12.dp.toPx()) ) }.background( - color = Color(0xFFFFF3F3), + color = HackathonTheme.colors.primaryContainer, shape = RoundedCornerShape(12.dp) ).clickable { onImageClick() }, contentAlignment = Alignment.Center diff --git a/feature/home/src/main/java/com/example/hackathon/feature/home/SearchScreen.kt b/feature/home/src/main/java/com/example/hackathon/feature/home/SearchScreen.kt index 598719a..46eabf8 100644 --- a/feature/home/src/main/java/com/example/hackathon/feature/home/SearchScreen.kt +++ b/feature/home/src/main/java/com/example/hackathon/feature/home/SearchScreen.kt @@ -40,7 +40,6 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.example.hackathon.core.designsystem.R import com.example.hackathon.core.designsystem.theme.Gray700 import com.example.hackathon.core.designsystem.theme.HackathonTheme -import com.example.hackathon.feature.home.SearchViewModel import com.example.hackathon.feature.home.component.CombinationList @Composable @@ -100,7 +99,7 @@ fun SearchScreen( Icon( painter = painterResource(R.drawable.ic_search), contentDescription = "search", - tint = Color(0xFF8B91A1), + tint = HackathonTheme.colors.iconUnselected, modifier = Modifier.clickable { viewModel.onSearch(uiState.query) diff --git a/feature/home/src/main/java/com/example/hackathon/feature/home/component/SearchComponent.kt b/feature/home/src/main/java/com/example/hackathon/feature/home/component/SearchComponent.kt index b41ac1d..83c6aa7 100644 --- a/feature/home/src/main/java/com/example/hackathon/feature/home/component/SearchComponent.kt +++ b/feature/home/src/main/java/com/example/hackathon/feature/home/component/SearchComponent.kt @@ -14,7 +14,6 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.dp @@ -56,12 +55,12 @@ fun SearchComponent(modifier: Modifier = Modifier, onSearchClick: () -> Unit) { Icon( painter = painterResource(R.drawable.ic_search), contentDescription = "search component", - tint = Color(0xFF8B91A1) + tint = HackathonTheme.colors.iconUnselected ) Text( text = "오늘은 어떤 꿀조합을 찾고 싶으신가요?", style = HackathonTheme.typography.Caption_medium, - color = Color(0xFF8B91A1) + color = HackathonTheme.colors.iconUnselected ) } }