I want a box that is 70% red and 30% blue (vertically).
CSS equivalent would be(Test here https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/linear-gradient)
background: linear-gradient(to bottom, blue 0 70%, red 70% 100%)
What I Do not want to do –
Column(){
Box(modifier.backgroud(blue).height(70.df))
Box(modifier.backgroud(red).height(30.df))
}
Because, Inside the Box, there is a piece of code for drawing a graph.
Basically I want the graph to have red background below 30 unit in y-axis(0-100) and above it blue background
Box
with 70% blue and 30% red.
Box(
modifier = Modifier
.fillMaxSize()
.background(
brush = Brush.verticalGradient(
0.7f to Color.Blue,
0.3f to Color.Red,
)
)
)