verticalGradient

fun verticalGradient(vararg colorStops: Pair<Float, ColorSchema>, startY: Int = 0, endY: Int? = null, tileMode: TileModeSchema = TileModeSchema.CLAMP, alpha: Float = 1.0f): BackgroundSchema.VerticalGradient

Vertical gradient background running from startY to endY, with explicit color stops. Dimensions are in dp; endY left null means the tile's bottom edge.

Parameters

colorStops

Explicit stop to color pairs, e.g. 0f to color(...).

startY

Starting y position, in dp. Defaults to 0.

endY

Ending y position, in dp. Defaults to none (the tile's bottom edge).

tileMode

How the gradient repeats past its endY when it doesn't cover the whole tile. Defaults to clamp (extends the last color).

alpha

Opacity applied to the whole gradient, from 0f to 1f. Defaults to 1f.


fun verticalGradient(colors: List<ColorSchema>, startY: Int = 0, endY: Int? = null, tileMode: TileModeSchema = TileModeSchema.CLAMP, alpha: Float = 1.0f): BackgroundSchema.VerticalGradient

Vertical gradient background running from startY to endY, with colors spread evenly along the line. Dimensions are in dp; endY left null means the tile's bottom edge.

Parameters

colors

Colors spread evenly along the gradient.

startY

Starting y position, in dp. Defaults to 0.

endY

Ending y position, in dp. Defaults to none (the tile's bottom edge).

tileMode

How the gradient repeats past its endY when it doesn't cover the whole tile. Defaults to clamp (extends the last color).

alpha

Opacity applied to the whole gradient, from 0f to 1f. Defaults to 1f.