Skip to content

Commit

Permalink
Replace primary container color with primary with alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
Pururun committed Oct 2, 2023
1 parent bb3737b commit cab27ae
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.compositeOver
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
import net.mullvad.mullvadvpn.R
import net.mullvad.mullvadvpn.compose.component.ChevronView
import net.mullvad.mullvadvpn.lib.theme.Alpha40
import net.mullvad.mullvadvpn.lib.theme.AlphaInactive
import net.mullvad.mullvadvpn.lib.theme.AlphaInvisible
import net.mullvad.mullvadvpn.lib.theme.AlphaVisible
Expand Down Expand Up @@ -165,7 +167,10 @@ fun RelayLocationCell(
when {
selected -> MaterialTheme.colorScheme.inversePrimary
relay.type == RelayItemType.Country -> MaterialTheme.colorScheme.primary
relay.type == RelayItemType.City -> MaterialTheme.colorScheme.primaryContainer
relay.type == RelayItemType.City ->
MaterialTheme.colorScheme.primary
.copy(alpha = Alpha40)
.compositeOver(MaterialTheme.colorScheme.background)
relay.type == RelayItemType.Relay -> MaterialTheme.colorScheme.secondaryContainer
else -> MaterialTheme.colorScheme.primary
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import androidx.compose.ui.unit.dp
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import net.mullvad.mullvadvpn.R
import net.mullvad.mullvadvpn.lib.theme.Alpha40
import net.mullvad.mullvadvpn.lib.theme.AppTheme
import net.mullvad.mullvadvpn.lib.theme.Dimens
import net.mullvad.mullvadvpn.lib.theme.typeface.listItemText
Expand Down Expand Up @@ -68,9 +69,9 @@ fun SplitTunnelingCell(
.fillMaxWidth()
.padding(vertical = Dimens.listItemDivider)
.background(
MaterialTheme.colorScheme.primaryContainer.compositeOver(
MaterialTheme.colorScheme.background
)
MaterialTheme.colorScheme.primary
.copy(alpha = Alpha40)
.compositeOver(MaterialTheme.colorScheme.background)
)
.clickable(onClick = onCellClicked)
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import androidx.compose.ui.graphics.Color

internal val MullvadBeige = Color(0xFFFFCD86)
internal val MullvadBlue60 = Color(0x99294D73)
internal val MullvadBlue40 = Color(0x66294D73)
internal val MullvadBlue20 = Color(0x33294D73)
internal val MullvadBrown = Color(0xFFD2943B)
internal val MullvadYellow = Color(0xFFFFD524)
Expand Down Expand Up @@ -55,6 +54,7 @@ const val AlphaVisible = 1f
const val AlphaDisabled = 0.2f
const val Alpha20 = 0.2f
const val AlphaInactive = 0.4f
const val Alpha40 = 0.4f
const val AlphaDescription = 0.6f
const val AlphaDisconnectButton = 0.6f
const val AlphaTopBar = 0.8f
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ private val MullvadColorPalette =
tertiary = MullvadRed,
background = MullvadDarkBlue,
surface = MullvadGreen,
primaryContainer = MullvadBlue40,
secondaryContainer = MullvadBlue20,
onBackground = MullvadWhite,
onSurfaceVariant = MullvadWhite,
Expand Down

0 comments on commit cab27ae

Please sign in to comment.