# ColorBuilders.ColorStop

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/wear/protolayout/ColorBuilders.ColorStop "View this page in Java")

<br />

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

<br />

*** ** * ** ***

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

## Summary

|                                                                                                                               ### Nested types                                                                                                                               |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[ColorBuilders.ColorStop.Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorStop.Builder) Builder for[ColorStop](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorStop) |

|                                                     ### Public functions                                                     |
|------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ColorBuilders.ColorProp](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorProp)  | [getColor](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorStop#getColor())`()` Gets the color for this stop.                               |
| [TypeBuilders.FloatProp](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.FloatProp)`?` | [getOffset](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorStop#getOffset())`()` Gets the relative offset for this color, between 0 and 1. |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                            | [toString](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorStop#toString())`()`                                                             |

## Public functions

### getColor

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

```
fun getColor(): ColorBuilders.ColorProp
```

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)  

```
fun getOffset(): TypeBuilders.FloatProp?
```

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

### toString

```
fun toString(): String
```