Coverage Summary for Class: SemanticColors (com.georgeci.moneysurfer.uikit.theme)
| Class |
Class, %
|
Method, %
|
Branch, %
|
Line, %
|
Instruction, %
|
| SemanticColors |
100%
(1/1)
|
100%
(1/1)
|
|
100%
(6/6)
|
100%
(70/70)
|
package com.georgeci.moneysurfer.uikit.theme
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.graphics.Color
import com.georgeci.moneysurfer.uikit.tokens.AppColors
/**
* Deliberately not `@Immutable`: [categoryTints] is a plain [List], so the deep-immutability
* contract that annotation promises cannot be enforced at the type level. Nothing needs it —
* this travels through [LocalSemanticColors], a *static* composition local that does not track
* reads, and is never passed as a composable parameter.
*/
data class SemanticColors(
val income: Color = AppColors.Income,
val expense: Color = AppColors.Expense,
val transfer: Color = AppColors.Transfer,
/** Caution accent — a budget past its alert threshold but not yet over. */
val warning: Color = AppColors.Warning,
/**
* Category tints in palette order. Read through `SurferCategoryPalette`, which owns the
* hue/icon-key mapping onto this list; call sites go through its resolvers.
*/
val categoryTints: List<Color> = AppColors.CategoryTints,
)
internal val LightSemanticColors = SemanticColors(
income = AppColors.Income,
expense = AppColors.Expense,
transfer = AppColors.Transfer,
warning = AppColors.Warning,
categoryTints = AppColors.CategoryTints,
)
internal val DarkSemanticColors = SemanticColors(
income = AppColors.Dark.Income,
expense = AppColors.Dark.Expense,
transfer = AppColors.Dark.Transfer,
warning = AppColors.Dark.Warning,
categoryTints = AppColors.Dark.CategoryTints,
)
val LocalSemanticColors = staticCompositionLocalOf { LightSemanticColors }