linearGradient

fun linearGradient(vararg colorStops: Pair<Float, ColorSchema>, start: OffsetSchema = OffsetSchema.Zero, end: OffsetSchema? = null, tileMode: TileModeSchema = TileModeSchema.CLAMP, alpha: Float = 1.0f): BackgroundSchema.LinearGradient

Linear gradient background running from start to end, with explicit color stops. Dimensions are in dp; end left null means the far edge of the tile.

Parameters

colorStops

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

start

Starting point of the gradient line. Defaults to the tile's origin (0, 0).

end

Ending point of the gradient line. Defaults to none (the tile's far edge).

tileMode

How the gradient repeats past its end 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 linearGradient(colors: List<ColorSchema>, start: OffsetSchema = OffsetSchema.Zero, end: OffsetSchema? = null, tileMode: TileModeSchema = TileModeSchema.CLAMP, alpha: Float = 1.0f): BackgroundSchema.LinearGradient

Linear gradient background running from start to end, with colors spread evenly along the line. Dimensions are in dp; end left null means the far edge of the tile.

Parameters

colors

Colors spread evenly along the gradient.

start

Starting point of the gradient line. Defaults to the tile's origin (0, 0).

end

Ending point of the gradient line. Defaults to none (the tile's far edge).

tileMode

How the gradient repeats past its end 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.