Skip to content

Commit

Permalink
fix: background
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisbordet committed Oct 25, 2024
1 parent 3918cd4 commit 9dac283
Showing 1 changed file with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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)
}
}

0 comments on commit 9dac283

Please sign in to comment.