radialGradient

fun radialGradient(vararg colorStops: Pair<Float, ColorSchema>, center: OffsetSchema? = null, radius: Int? = null, tileMode: TileModeSchema = TileModeSchema.CLAMP, alpha: Float = 1.0f): BackgroundSchema.RadialGradient

Radial gradient background radiating out from center, with explicit color stops. Dimensions are in dp; center left null means the tile's own center, and radius left null means the largest radius that still fits the tile.

Parameters

colorStops

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

center

Center point the gradient radiates from. Defaults to none (the tile's center).

radius

Radius of the gradient, in dp. Defaults to none (the largest radius that fits the tile).

tileMode

How the gradient repeats past its radius 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 radialGradient(colors: List<ColorSchema>, center: OffsetSchema? = null, radius: Int? = null, tileMode: TileModeSchema = TileModeSchema.CLAMP, alpha: Float = 1.0f): BackgroundSchema.RadialGradient

Radial gradient background radiating out from center, with colors spread evenly along the radius. Dimensions are in dp; center left null means the tile's own center, and radius left null means the largest radius that still fits the tile.

Parameters

colors

Colors spread evenly along the gradient.

center

Center point the gradient radiates from. Defaults to none (the tile's center).

radius

Radius of the gradient, in dp. Defaults to none (the largest radius that fits the tile).

tileMode

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