diff --git a/ShaderBackground/src/commonMain/kotlin/tech/bam/dojo/shaderbackground/FreetimeLanceTrackerBackground.kt b/ShaderBackground/src/commonMain/kotlin/tech/bam/dojo/shaderbackground/FreetimeLanceTrackerBackground.kt index 368fdbd..9df95f7 100644 --- a/ShaderBackground/src/commonMain/kotlin/tech/bam/dojo/shaderbackground/FreetimeLanceTrackerBackground.kt +++ b/ShaderBackground/src/commonMain/kotlin/tech/bam/dojo/shaderbackground/FreetimeLanceTrackerBackground.kt @@ -4,10 +4,8 @@ import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import androidx.compose.ui.composed import tech.bam.dojo.freetimelancetracker.theme.FreetimelanceTrackerColors -// TODO: investigate why box works on skia but android need an image @Composable fun FreeTimeLanceTrackerBackground(modifier: Modifier = Modifier) { Box( @@ -17,17 +15,16 @@ fun FreeTimeLanceTrackerBackground(modifier: Modifier = Modifier) { ) } -fun Modifier.freetimeLanceTrackerBackground(): Modifier = composed { - this then shaderBrush(GradientShader) { - uniform("color1a", FreetimelanceTrackerColors.purple) - uniform("color1b", FreetimelanceTrackerColors.yellow) - uniform("color2a", FreetimelanceTrackerColors.purple) - uniform("color2b", FreetimelanceTrackerColors.purple) +fun Modifier.freetimeLanceTrackerBackground(): Modifier = this then + runtimeShader( + NoiseGrain, + "image" + ) { + uniform("intensity", 0.04f) } - .runtimeShader( - NoiseGrain, - "image" - ) { - uniform("intensity", 0.15f) + .shaderBrush(GradientShader) { + uniform("color1a", FreetimelanceTrackerColors.purple) + uniform("color1b", FreetimelanceTrackerColors.yellow) + uniform("color2a", FreetimelanceTrackerColors.purple) + uniform("color2b", FreetimelanceTrackerColors.purple) } -}