🛠️ Reformat BlackTheme .copy() function
* Removed .copy() function and replaced with .run()
This commit is contained in:
parent
83260d354d
commit
3de024457b
1 changed files with 3 additions and 7 deletions
|
|
@ -12,12 +12,12 @@ fun blackTheme(initialTheme: ColorScheme): ColorScheme {
|
||||||
val surfaceContainerDarker = if (absoluteDark) 3f else 1.95f
|
val surfaceContainerDarker = if (absoluteDark) 3f else 1.95f
|
||||||
|
|
||||||
return initialTheme.copy(
|
return initialTheme.copy(
|
||||||
surface = initialTheme.surface.copy {
|
surface = initialTheme.surface.run {
|
||||||
if (absoluteDark) {
|
if (absoluteDark) {
|
||||||
return@copy Color.Black
|
return@run Color.Black
|
||||||
}
|
}
|
||||||
|
|
||||||
it.darkenBy(surfaceDarker)
|
darkenBy(surfaceDarker)
|
||||||
},
|
},
|
||||||
surfaceContainer = initialTheme.surfaceContainer.darkenBy(
|
surfaceContainer = initialTheme.surfaceContainer.darkenBy(
|
||||||
surfaceContainerDarker
|
surfaceContainerDarker
|
||||||
|
|
@ -37,10 +37,6 @@ fun blackTheme(initialTheme: ColorScheme): ColorScheme {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun Color.copy(calculation: (Color) -> Color): Color {
|
|
||||||
return calculation(this)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun Color.darkenBy(value: Float): Color {
|
private fun Color.darkenBy(value: Float): Color {
|
||||||
return copy(
|
return copy(
|
||||||
red = red / value,
|
red = red / value,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue