---
title: "angularGradientBackground"
description: "Specifies a sweep gradient background for a curved element."
type: "function"
---

<div class='type'>Function</div>


<a id='references'></a>
<div class='sourceset sourceset-android'>Android</div>


```kotlin
public fun CurvedModifier.angularGradientBackground(
    vararg colorStops: Pair<Float, Color>,
    cap: StrokeCap = StrokeCap.Butt,
): CurvedModifier
```


Specifies a sweep gradient background for a curved element.

#### Parameters

| | |
| --- | --- |
| colorStops | Colors and their offset in the gradient area. Note that the offsets should be in ascending order. 0 means where the curved element starts laying out, 1 means the end |
| cap | How to start and end the background. |




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


```kotlin
public fun CurvedModifier.angularGradientBackground(
    colors: List<Color>,
    cap: StrokeCap = StrokeCap.Butt,
): CurvedModifier
```


Specifies a sweep gradient background for a curved element.

#### Parameters

| | |
| --- | --- |
| colors | Colors in the gradient area. Gradient goes in the clockwise direction. |
| cap | How to start and end the background. |




## Code Examples
### CurvedBackground
```kotlin
@Composable
fun CurvedBackground() {
    CurvedLayout(modifier = Modifier.fillMaxSize()) {
        basicCurvedText(
            "Radial",
            style = { CurvedTextStyle(fontSize = 16.sp, color = Color.Black) },
            modifier =
                CurvedModifier.radialGradientBackground(0f to Color.White, 1f to Color.Black)
                    .padding(5.dp),
        )
        basicCurvedText(
            "Angular",
            style = { CurvedTextStyle(fontSize = 16.sp, color = Color.Black) },
            modifier =
                CurvedModifier.angularGradientBackground(0f to Color.White, 1f to Color.Black)
                    .padding(5.dp),
        )
    }
}
```

