# ColorBuilders.ColorStop

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/ColorBuilders.java+class:androidx.wear.protolayout.ColorBuilders.ColorStop) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.1.0)

*** ** * ** ***


```
@RequiresSchemaVersion(major = 1, minor = 300)
public final class ColorBuilders.ColorStop
```

<br />

*** ** * ** ***

A color and an offset, determining a color position in a gradient.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/wear/protolayout/ColorBuilders.ColorStop.Builder` Builder for `https://developer.android.com/reference/androidx/wear/protolayout/ColorBuilders.ColorStop` |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/ColorBuilders.ColorProp` | `https://developer.android.com/reference/androidx/wear/protolayout/ColorBuilders.ColorStop#getColor()()` Gets the color for this stop. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/wear/protolayout/TypeBuilders.FloatProp` | `https://developer.android.com/reference/androidx/wear/protolayout/ColorBuilders.ColorStop#getOffset()()` Gets the relative offset for this color, between 0 and 1. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/wear/protolayout/ColorBuilders.ColorStop#toString()()` |

## Public methods

### getColor

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.1.0)

```
public @NonNull ColorBuilders.ColorProp getColor()
```

Gets the color for this stop. Only opaque colors are supported. Any transparent colors will have their alpha component set to 0xFF (opaque).

### getOffset

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.1.0)

```
public @Nullable TypeBuilders.FloatProp getOffset()
```

Gets the relative offset for this color, between 0 and 1. This determines where the color is positioned relative to a gradient space.

### toString

```
public @NonNull String toString()
```