Skip to content

Commit

Permalink
Review: Organize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
paulinea committed Dec 18, 2024
1 parent 68a7496 commit 921f66f
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions core/src/main/java/com/orange/ouds/core/theme/OudsColorScheme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ import androidx.compose.runtime.ReadOnlyComposable
import androidx.compose.runtime.Stable
import androidx.compose.ui.graphics.Color
import com.orange.ouds.theme.tokens.OudsColorKeyToken
import com.orange.ouds.theme.tokens.OudsColorKeyToken.Background
import com.orange.ouds.theme.tokens.android.OudsAndroidColorDarkTokens
import com.orange.ouds.theme.tokens.android.OudsAndroidColorLightTokens
import com.orange.ouds.theme.tokens.android.OudsAndroidColorLightTokens.surfaceVariant
import com.orange.ouds.theme.tokens.semantic.OudsColorSemanticTokens

data class OudsColorScheme(
Expand Down Expand Up @@ -664,13 +662,13 @@ fun OudsColorScheme.fromToken(token: OudsColorKeyToken.Always): Color {
}

@Stable
fun OudsColorScheme.fromToken(token: Background): Color {
fun OudsColorScheme.fromToken(token: OudsColorKeyToken.Background): Color {
return with(backgroundColors) {
when (token) {
Background.Emphasized -> emphasized
Background.Primary -> primary
Background.Secondary -> secondary
Background.Tertiary -> tertiary
OudsColorKeyToken.Background.Emphasized -> emphasized
OudsColorKeyToken.Background.Primary -> primary
OudsColorKeyToken.Background.Secondary -> secondary
OudsColorKeyToken.Background.Tertiary -> tertiary
}
}
}
Expand Down Expand Up @@ -950,7 +948,7 @@ val OudsColorKeyToken.value: Color
get() = when (this) {
is OudsColorKeyToken.Action -> OudsTheme.colorScheme.fromToken(this)
is OudsColorKeyToken.Always -> OudsTheme.colorScheme.fromToken(this)
is Background -> OudsTheme.colorScheme.fromToken(this)
is OudsColorKeyToken.Background -> OudsTheme.colorScheme.fromToken(this)
is OudsColorKeyToken.Border -> OudsTheme.colorScheme.fromToken(this)
is OudsColorKeyToken.Content -> OudsTheme.colorScheme.fromToken(this)
is OudsColorKeyToken.Decorative -> OudsTheme.colorScheme.fromToken(this)
Expand Down

0 comments on commit 921f66f

Please sign in to comment.