Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3b427623 authored by Marcelo Arteiro's avatar Marcelo Arteiro
Browse files

Updates custom color tokens in Compose

Added Tokens:
brandA
brandB
brandC
brandD
clockHour
clockMinute
clockSecond
onShadeActive
onShadeActiveVariant
onShadeInactive
onShadeInactiveVariant
onThemeApp
overviewBackground
shadeActive
shadeDisabled
shadeInactive
themeApp
themeAppRing
themeNotif
underSurface
weatherTemp
widgetBackground

Bug: 327348461
Test: Existing Unit Tests
Flag: EXEMPT refactor
Change-Id: I41695fc19943dcf97a7df6f26e16306c509a2d59
parent 64cf3ae5
Loading
Loading
Loading
Loading
+50 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ val LocalAndroidColorScheme =
 */
@Immutable
class AndroidColorScheme(
    // fixed tokens
    val primaryFixed: Color,
    val primaryFixedDim: Color,
    val onPrimaryFixed: Color,
@@ -53,6 +54,30 @@ class AndroidColorScheme(
    val tertiaryFixedDim: Color,
    val onTertiaryFixed: Color,
    val onTertiaryFixedVariant: Color,

    // custom tokens
    val brandA: Color,
    val brandB: Color,
    val brandC: Color,
    val brandD: Color,
    val clockHour: Color,
    val clockMinute: Color,
    val clockSecond: Color,
    val onShadeActive: Color,
    val onShadeActiveVariant: Color,
    val onShadeInactive: Color,
    val onShadeInactiveVariant: Color,
    val onThemeApp: Color,
    val overviewBackground: Color,
    val shadeActive: Color,
    val shadeDisabled: Color,
    val shadeInactive: Color,
    val themeApp: Color,
    val themeAppRing: Color,
    val themeNotif: Color,
    val underSurface: Color,
    val weatherTemp: Color,
    val widgetBackground: Color,
) {
    companion object {
        internal fun color(context: Context, @ColorRes id: Int): Color {
@@ -61,6 +86,7 @@ class AndroidColorScheme(

        operator fun invoke(context: Context): AndroidColorScheme {
            return AndroidColorScheme(
                // Fixed tokens.
                primaryFixed = color(context, R.color.system_primary_fixed),
                primaryFixedDim = color(context, R.color.system_primary_fixed_dim),
                onPrimaryFixed = color(context, R.color.system_on_primary_fixed),
@@ -73,6 +99,30 @@ class AndroidColorScheme(
                tertiaryFixedDim = color(context, R.color.system_tertiary_fixed_dim),
                onTertiaryFixed = color(context, R.color.system_on_tertiary_fixed),
                onTertiaryFixedVariant = color(context, R.color.system_on_tertiary_fixed_variant),

                // Custom tokens.
                brandA = color(context, R.color.customColorBrandA),
                brandB = color(context, R.color.customColorBrandB),
                brandC = color(context, R.color.customColorBrandC),
                brandD = color(context, R.color.customColorBrandD),
                clockHour = color(context, R.color.customColorClockHour),
                clockMinute = color(context, R.color.customColorClockMinute),
                clockSecond = color(context, R.color.customColorClockSecond),
                onShadeActive = color(context, R.color.customColorOnShadeActive),
                onShadeActiveVariant = color(context, R.color.customColorOnShadeActiveVariant),
                onShadeInactive = color(context, R.color.customColorOnShadeInactive),
                onShadeInactiveVariant = color(context, R.color.customColorOnShadeInactiveVariant),
                onThemeApp = color(context, R.color.customColorOnThemeApp),
                overviewBackground = color(context, R.color.customColorOverviewBackground),
                shadeActive = color(context, R.color.customColorShadeActive),
                shadeDisabled = color(context, R.color.customColorShadeDisabled),
                shadeInactive = color(context, R.color.customColorShadeInactive),
                themeApp = color(context, R.color.customColorThemeApp),
                themeAppRing = color(context, R.color.customColorThemeAppRing),
                themeNotif = color(context, R.color.customColorThemeNotif),
                underSurface = color(context, R.color.customColorUnderSurface),
                weatherTemp = color(context, R.color.customColorWeatherTemp),
                widgetBackground = color(context, R.color.customColorWidgetBackground),
            )
        }
    }