Function

radialGradient

Creates a radial gradient with the given colors at the provided offset defined in the colorstop pair.

radialGradient

Source set: JvmAndAndroid
public fun RemoteBrush.Companion.radialGradient(
    vararg colorStops: Pair<RemoteFloat, RemoteColor>,
    center: RemoteOffset? = null,
    radius: RemoteFloat? = null,
    tileMode: RemoteTileMode = RemoteTileMode.Clamp,
): RemoteShaderBrush

Creates a radial gradient with the given colors at the provided offset defined in the colorstop pair.

RemoteBrush.radialGradient(
0.0f.rf to 0xFFFF0000.rc,
0.3f.rf to 0xFF00FF00.rc,
1.0f.rf to 0xFF0000FF.rc,
center = RemoteOffset(side1 / 2.0f, side2 / 2.0f),
radius = side1 / 2.0f,
tileMode = RemoteTileMode.Repeated,
)

Parameters

colorStops colors and offsets to determine how the colors are dispersed throughout the radial gradient
center center position of the radial gradient circle, or null to center within the drawing area. Float.POSITIVE_INFINITY can be used for either RemoteOffset.x or RemoteOffset.y to indicate the far right or far bottom of the drawing area respectively.
radius radius for the radial gradient, or null to use the largest radius fitting the drawing area
tileMode determines how the shader fills regions outside its bounds

Return

a RemoteShaderBrush that draws a radial gradient with the given colorStops

radialGradient

Source set: JvmAndAndroid
public fun RemoteBrush.Companion.radialGradient(
    colors: List<RemoteColor>,
    center: RemoteOffset? = null,
    radius: RemoteFloat? = null,
    tileMode: RemoteTileMode = RemoteTileMode.Clamp,
): RemoteShaderBrush

Creates a radial gradient with the given colors evenly dispersed within the gradient.

RemoteBrush.radialGradient(
listOf(0xFFFF0000.rc, 0xFF0000FF.rc),
center = RemoteOffset(side1 / 2.0f, side2 / 2.0f),
radius = side1 / 2.0f,
tileMode = RemoteTileMode.Repeated,
)

Parameters

colors colors to be rendered as part of the gradient
center center position of the radial gradient circle, or null to center within the drawing area. Float.POSITIVE_INFINITY can be used for either RemoteOffset.x or RemoteOffset.y to indicate the far right or far bottom of the drawing area respectively.
radius radius for the radial gradient, or null to use the largest radius fitting the drawing area
tileMode determines how the shader fills regions outside its bounds

Return

a RemoteShaderBrush that draws a radial gradient across the given colors

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: