Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace primary container color with primary with alpha #5216

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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