object RemoteBrush.Companion


Summary

Extension functions

RemoteShaderBrush
RemoteBrush.Companion.image(
    image: RemoteImageBitmap,
    tileModeX: TileMode,
    tileModeY: TileMode,
    contentScale: ContentScale
)

Creates a texture brush with a specified image.

RemoteShaderBrush
RemoteBrush.Companion.horizontalGradient(
    colors: List<RemoteColor>,
    startX: RemoteFloat?,
    endX: RemoteFloat?,
    tileMode: TileMode
)

Creates a horizontal gradient with the given colors evenly dispersed within the gradient

RemoteShaderBrush
RemoteBrush.Companion.linearGradient(
    colors: List<RemoteColor>,
    start: RemoteOffset?,
    end: RemoteOffset?,
    tileMode: TileMode
)

Creates a linear gradient with the provided colors along the given start and end coordinates.

RemoteShaderBrush
RemoteBrush.Companion.verticalGradient(
    colors: List<RemoteColor>,
    startY: RemoteFloat?,
    endY: RemoteFloat?,
    tileMode: TileMode
)

Creates a vertical gradient with the given colors evenly dispersed within the gradient Ex:

RemoteShaderBrush
RemoteBrush.Companion.radialGradient(
    vararg colorStops: Pair<RemoteFloat, RemoteColor>,
    center: RemoteOffset?,
    radius: RemoteFloat?,
    tileMode: TileMode
)

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

RemoteShaderBrush
RemoteBrush.Companion.radialGradient(
    colors: List<RemoteColor>,
    center: RemoteOffset?,
    radius: RemoteFloat?,
    tileMode: TileMode
)

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

RemoteBrush

Creates a solid color brush.

RemoteShaderBrush
RemoteBrush.Companion.sweepGradient(
    vararg colorStops: Pair<RemoteFloat, RemoteColor>,
    center: RemoteOffset?
)

Creates a sweep gradient with the given colors dispersed around the center with offsets defined in each colorstop pair.

RemoteShaderBrush
RemoteBrush.Companion.sweepGradient(
    colors: List<RemoteColor>,
    center: RemoteOffset?
)

Creates a sweep gradient with the given colors dispersed evenly around the center.

Extension functions

RemoteBrush.Companion.image

fun RemoteBrush.Companion.image(
    image: RemoteImageBitmap,
    tileModeX: TileMode = ComposeTileMode.Clamp,
    tileModeY: TileMode = ComposeTileMode.Clamp,
    contentScale: ContentScale = ContentScale.None
): RemoteShaderBrush

Creates a texture brush with a specified image.

Parameters
image: RemoteImageBitmap

The RemoteImageBitmap to use

tileModeX: TileMode = ComposeTileMode.Clamp

The ComposeTileMode to use for the bitmap in the x-axis. Defaults to ComposeTileMode.Clamp to repeat the edge pixels

tileModeY: TileMode = ComposeTileMode.Clamp

The ComposeTileMode to use for the bitmap in the y-axis. Defaults to ComposeTileMode.Clamp to repeat the edge pixels

contentScale: ContentScale = ContentScale.None

The ContentScale to use when scaling the bitmap.

RemoteBrush.Companion.horizontalGradient

fun RemoteBrush.Companion.horizontalGradient(
    colors: List<RemoteColor>,
    startX: RemoteFloat? = null,
    endX: RemoteFloat? = null,
    tileMode: TileMode = ComposeTileMode.Clamp
): RemoteShaderBrush

Creates a horizontal gradient with the given colors evenly dispersed within the gradient

Ex:

 Brush.horizontalGradient(
listOf(Color.Red.rc, Color.Green.rc, Color.Blue.rc),
startX = 10.rf,
endX = 20.rf
)
Parameters
colors: List<RemoteColor>

colors to be rendered as part of the gradient

startX: RemoteFloat? = null

Starting x position of the horizontal gradient. Defaults to 0 which represents the left of the drawing area

endX: RemoteFloat? = null

Ending x position of the horizontal gradient. Defaults to Float.POSITIVE_INFINITY which indicates the right of the specified drawing area

tileMode: TileMode = ComposeTileMode.Clamp

Determines the behavior for how the shader is to fill a region outside its bounds. Defaults to ComposeTileMode.Clamp to repeat the edge pixels

RemoteBrush.Companion.linearGradient

fun RemoteBrush.Companion.linearGradient(
    colors: List<RemoteColor>,
    start: RemoteOffset? = null,
    end: RemoteOffset? = null,
    tileMode: TileMode = ComposeTileMode.Clamp
): RemoteShaderBrush

Creates a linear gradient with the provided colors along the given start and end coordinates.

 Brush.linearGradient(
listOf(Color.Red.rc, Color.Blue.rc),
start = Offset(0.rf, 50.rf)
end = Offset(0.rf, 100.rf)
)
Parameters
colors: List<RemoteColor>

Colors to be rendered as part of the gradient

start: RemoteOffset? = null

Starting position of the linear gradient. This can be set to RemoteOffset.Zero to position at the far left and top of the drawing area

end: RemoteOffset? = null

Ending position of the linear gradient. This can be set to RemoteOffset Infinite to position at the far right and bottom of the drawing area

tileMode: TileMode = ComposeTileMode.Clamp

Determines the behavior for how the shader is to fill a region outside its bounds. Defaults to ComposeTileMode.Clamp to repeat the edge pixels

RemoteBrush.Companion.verticalGradient

fun RemoteBrush.Companion.verticalGradient(
    colors: List<RemoteColor>,
    startY: RemoteFloat? = null,
    endY: RemoteFloat? = null,
    tileMode: TileMode = ComposeTileMode.Clamp
): RemoteShaderBrush

Creates a vertical gradient with the given colors evenly dispersed within the gradient Ex:

 Brush.verticalGradient(
listOf(Color.Red.rc, Color.Green.rc, Color.Blue.rc),
startY = 0.rf,
endY = 100.rf
)
Parameters
colors: List<RemoteColor>

colors to be rendered as part of the gradient

startY: RemoteFloat? = null

Starting y position of the vertical gradient. Defaults to 0 which represents the top of the drawing area

endY: RemoteFloat? = null

Ending y position of the vertical gradient. Defaults to Float.POSITIVE_INFINITY which indicates the bottom of the specified drawing area

tileMode: TileMode = ComposeTileMode.Clamp

Determines the behavior for how the shader is to fill a region outside its bounds. Defaults to ComposeTileMode.Clamp to repeat the edge pixels

RemoteBrush.Companion.radialGradient

fun RemoteBrush.Companion.radialGradient(
    vararg colorStops: Pair<RemoteFloat, RemoteColor>,
    center: RemoteOffset? = null,
    radius: RemoteFloat? = null,
    tileMode: TileMode = ComposeTileMode.Clamp
): RemoteShaderBrush

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

Brush.radialGradient(
0.0f to Color.Red.rc,
0.3f to Color.Green.rc,
1.0f to Color.Blue.rc,
center = Offset(side1 / 2.0f, side2 / 2.0f),
radius = side1 / 2.0f,
tileMode = TileMode.Repeated
)
Parameters
vararg colorStops: Pair<RemoteFloat, RemoteColor>

Colors and offsets to determine how the colors are dispersed throughout the radial gradient

center: RemoteOffset? = null

Center position of the radial gradient circle. If this is set to Offset.Unspecified then the center of the drawing area is used as the center for the radial gradient. Float.POSITIVE_INFINITY can be used for either Offset.x or Offset.y to indicate the far right or far bottom of the drawing area respectively.

radius: RemoteFloat? = null

Radius for the radial gradient. Defaults to positive infinity to indicate the largest radius that can fit within the bounds of the drawing area

tileMode: TileMode = ComposeTileMode.Clamp

Determines the behavior for how the shader is to fill a region outside its bounds. Defaults to ComposeTileMode.Clamp to repeat the edge pixels

RemoteBrush.Companion.radialGradient

fun RemoteBrush.Companion.radialGradient(
    colors: List<RemoteColor>,
    center: RemoteOffset? = null,
    radius: RemoteFloat? = null,
    tileMode: TileMode = ComposeTileMode.Clamp
): RemoteShaderBrush

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

Brush.radialGradient(
listOf(Color.Red.rc, Color.Blue.rc),
center = Offset(side1 / 2.0f, side2 / 2.0f),
radius = side1 / 2.0f,
tileMode = TileMode.Repeated
)
Parameters
colors: List<RemoteColor>

Colors to be rendered as part of the gradient

center: RemoteOffset? = null

Center position of the radial gradient circle. If this is set to Offset.Unspecified then the center of the drawing area is used as the center for the radial gradient. Float.POSITIVE_INFINITY can be used for either Offset.x or Offset.y to indicate the far right or far bottom of the drawing area respectively.

radius: RemoteFloat? = null

Radius for the radial gradient. Defaults to positive infinity to indicate the largest radius that can fit within the bounds of the drawing area

tileMode: TileMode = ComposeTileMode.Clamp

Determines the behavior for how the shader is to fill a region outside its bounds. Defaults to ComposeTileMode.Clamp to repeat the edge pixels

RemoteBrush.Companion.solidColor

fun RemoteBrush.Companion.solidColor(color: RemoteColor): RemoteBrush

Creates a solid color brush.

Parameters
color: RemoteColor

color to apply

RemoteBrush.Companion.sweepGradient

fun RemoteBrush.Companion.sweepGradient(
    vararg colorStops: Pair<RemoteFloat, RemoteColor>,
    center: RemoteOffset? = null
): RemoteShaderBrush

Creates a sweep gradient with the given colors dispersed around the center with offsets defined in each colorstop pair. The sweep begins relative to 3 o'clock and continues clockwise until it reaches the starting position again.

Ex:

 Brush.sweepGradient(
0.0.rf to Color.Red.rc,
0.3.rf to Color.Green.rc,
1.0.rf to Color.Blue.rc,
center = Offset(0.rf, 100.rf)
)
Parameters
vararg colorStops: Pair<RemoteFloat, RemoteColor>

Colors and offsets to determine how the colors are dispersed throughout the sweep gradient

center: RemoteOffset? = null

Center position of the sweep gradient circle. If this is set to null then the center of the drawing area is used as the center for the sweep gradient

RemoteBrush.Companion.sweepGradient

fun RemoteBrush.Companion.sweepGradient(
    colors: List<RemoteColor>,
    center: RemoteOffset? = null
): RemoteShaderBrush

Creates a sweep gradient with the given colors dispersed evenly around the center. The sweep begins relative to 3 o'clock and continues clockwise until it reaches the starting position again.

Ex:

 Brush.sweepGradient(
listOf(Color.Red.rc, Color.Blue.rc),
center = Offset(10.rf, 20.rf)
)
Parameters
colors: List<RemoteColor>

List of colors to fill the sweep gradient

center: RemoteOffset? = null

Center position of the sweep gradient circle. If this is null then the center of the drawing area is used as the center for the sweep gradient