Skip to content

Commit

Permalink
Update colors (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksharma-xyz authored Oct 22, 2024
1 parent d6fec7f commit 9f74c35
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package xyz.ksharma.krail.trip_planner.ui.components

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ExperimentalLayoutApi
Expand Down Expand Up @@ -47,7 +48,7 @@ fun JourneyLeg(
.background(
color = transportModeLine.transportMode.colorCode
.hexToComposeColor()
.copy(alpha = 0.15f)
.copy(alpha = if (isSystemInDarkTheme()) 0.7f else 0.2f)
)
.padding(vertical = 8.dp, horizontal = 8.dp),
) {
Expand All @@ -60,13 +61,14 @@ fun JourneyLeg(
backgroundColor = transportModeLine.transportMode.colorCode.hexToComposeColor(),
badgeText = transportModeLine.lineName,
badgeColor = transportModeLine.lineColorCode.hexToComposeColor(),
borderEnabled = isSystemInDarkTheme(),
modifier = Modifier.align(Alignment.CenterVertically),
)
Text(
text = stopsInfo,
modifier = Modifier.align(Alignment.CenterVertically),
style = KrailTheme.typography.title,
color = KrailTheme.colors.onSurface,//transportModeLine.transportMode.colorCode.hexToComposeColor(),
color = if (isSystemInDarkTheme()) KrailTheme.colors.onSurface else transportModeLine.transportMode.colorCode.hexToComposeColor(),
)
}
FlowRow(
Expand All @@ -87,8 +89,8 @@ fun JourneyLeg(
.size(size)
.align(Alignment.CenterVertically),
colorFilter = ColorFilter.tint(
color = transportModeLine.transportMode.colorCode.hexToComposeColor()
.copy(alpha = 0.9f)
color = if (isSystemInDarkTheme()) KrailTheme.colors.onSurface else transportModeLine.transportMode.colorCode.hexToComposeColor()
.copy(alpha = 0.9f),
),
)
Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ fun TransportModeInfo(
backgroundColor: Color,
badgeColor: Color,
badgeText: String,
borderEnabled: Boolean = false,
modifier: Modifier = Modifier,
) {
Row(modifier = modifier, horizontalArrangement = Arrangement.spacedBy(8.dp)) {
TransportModeIcon(letter = letter, backgroundColor = backgroundColor)
TransportModeIcon(letter = letter, backgroundColor = backgroundColor, borderEnabled = borderEnabled)

TransportModeBadge(
backgroundColor = badgeColor,
Expand Down

0 comments on commit 9f74c35

Please sign in to comment.