Skip to content

Commit

Permalink
Merge pull request wikimedia#5219 from wikimedia/follow-up-compose-color
Browse files Browse the repository at this point in the history
Follow up: Compose color styles
  • Loading branch information
Williamrai authored Jan 10, 2025
2 parents 29d979d + 78512df commit cb69962
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 121 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.wikipedia.theme
package org.wikipedia.compose

import androidx.compose.ui.graphics.Color

object ThemeColors {
object ComposeColors {
val White = Color(0xFFFFFFFF)

val Black = Color(0xFF000000)
Expand Down
117 changes: 0 additions & 117 deletions app/src/main/java/org/wikipedia/compose/WikipediaColor.kt

This file was deleted.

117 changes: 117 additions & 0 deletions app/src/main/java/org/wikipedia/compose/theme/WikipediaColor.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
package org.wikipedia.compose.theme

import androidx.compose.runtime.Immutable
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.graphics.Color
import org.wikipedia.compose.ComposeColors

@Immutable
data class WikipediaColor(
val primaryColor: Color,
val paperColor: Color,
val backgroundColor: Color,
val inactiveColor: Color,
val placeholderColor: Color,
val secondaryColor: Color,
val borderColor: Color,
val progressiveColor: Color,
val successColor: Color,
val destructiveColor: Color,
val warningColor: Color,
val highlightColor: Color,
val focusColor: Color,
val additionColor: Color,
val overlayColor: Color
)

val LocalWikipediaColor = staticCompositionLocalOf {
WikipediaColor(
primaryColor = Color.Unspecified,
paperColor = Color.Unspecified,
backgroundColor = Color.Unspecified,
inactiveColor = Color.Unspecified,
placeholderColor = Color.Unspecified,
secondaryColor = Color.Unspecified,
borderColor = Color.Unspecified,
progressiveColor = Color.Unspecified,
successColor = Color.Unspecified,
destructiveColor = Color.Unspecified,
warningColor = Color.Unspecified,
highlightColor = Color.Unspecified,
focusColor = Color.Unspecified,
additionColor = Color.Unspecified,
overlayColor = Color.Unspecified,
)
}

val LightColors = WikipediaColor(
primaryColor = ComposeColors.Gray700,
paperColor = ComposeColors.White,
backgroundColor = ComposeColors.Gray100,
inactiveColor = ComposeColors.Gray400,
placeholderColor = ComposeColors.Gray500,
secondaryColor = ComposeColors.Gray600,
borderColor = ComposeColors.Gray200,
progressiveColor = ComposeColors.Blue600,
successColor = ComposeColors.Green700,
destructiveColor = ComposeColors.Red700,
warningColor = ComposeColors.Yellow700,
highlightColor = ComposeColors.Yellow500,
focusColor = ComposeColors.Orange500,
additionColor = ComposeColors.Blue300_15,
overlayColor = ComposeColors.Black_30
)

val DarkColors = WikipediaColor(
primaryColor = ComposeColors.Gray200,
paperColor = ComposeColors.Gray700,
backgroundColor = ComposeColors.Gray675,
inactiveColor = ComposeColors.Gray500,
placeholderColor = ComposeColors.Gray400,
secondaryColor = ComposeColors.Gray300,
borderColor = ComposeColors.Gray650,
progressiveColor = ComposeColors.Blue300,
successColor = ComposeColors.Green600,
destructiveColor = ComposeColors.Red500,
warningColor = ComposeColors.Orange500,
highlightColor = ComposeColors.Yellow500_40,
focusColor = ComposeColors.Orange500_50,
additionColor = ComposeColors.Blue600_30,
overlayColor = ComposeColors.Black_70
)

val BlackColors = WikipediaColor(
primaryColor = ComposeColors.Gray200,
paperColor = ComposeColors.Black,
backgroundColor = ComposeColors.Gray700,
inactiveColor = ComposeColors.Gray500,
placeholderColor = ComposeColors.Gray500,
secondaryColor = ComposeColors.Gray300,
borderColor = ComposeColors.Gray675,
progressiveColor = ComposeColors.Blue300,
successColor = ComposeColors.Green600,
destructiveColor = ComposeColors.Red500,
warningColor = ComposeColors.Orange500,
highlightColor = ComposeColors.Yellow500_40,
focusColor = ComposeColors.Orange500_50,
additionColor = ComposeColors.Blue600_30,
overlayColor = ComposeColors.Black_70
)

val SepiaColors = WikipediaColor(
primaryColor = ComposeColors.Gray700,
paperColor = ComposeColors.Beige100,
backgroundColor = ComposeColors.Beige300,
inactiveColor = ComposeColors.Taupe200,
placeholderColor = ComposeColors.Taupe600,
secondaryColor = ComposeColors.Gray600,
borderColor = ComposeColors.Beige400,
progressiveColor = ComposeColors.Blue600,
successColor = ComposeColors.Gray700,
destructiveColor = ComposeColors.Red700,
warningColor = ComposeColors.Yellow700,
highlightColor = ComposeColors.Yellow500,
focusColor = ComposeColors.Orange500,
additionColor = ComposeColors.Blue300_15,
overlayColor = ComposeColors.Black_30
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.wikipedia.compose
package org.wikipedia.compose.theme

import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.runtime.Composable
Expand All @@ -9,7 +9,7 @@ enum class WikipediaThemeType {
}

@Composable
fun MainTheme(
fun BaseTheme(
wikipediaThemeType: WikipediaThemeType = WikipediaThemeType.SYSTEM,
content: @Composable () -> Unit
) {
Expand Down

0 comments on commit cb69962

Please sign in to comment.