<h2 id="horizontalgradient-colors-startx-endx-tilemode">horizontalGradient</h2>

<div class='sourceset sourceset-android'>Android</div>

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

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 | colors to be rendered as part of the gradient |
| startX | Starting x position of the horizontal gradient. Defaults to 0 which represents the left of the drawing area |
| endX | Ending x position of the horizontal gradient. Defaults to `Float.POSITIVE_INFINITY` which indicates the right of the specified drawing area |
| tileMode | Determines the behavior for how the shader is to fill a region outside its bounds. Defaults to [ComposeTileMode.Clamp](/jetpack-compose/androidx.compose.remote/remote-creation-compose/functions/clamp) to repeat the edge pixels |