# ColorBuilders.ColorProp.Builder

# ColorBuilders.ColorProp.Builder

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.ColorProp.Builder)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

*** ** * ** ***

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

<br />

```
class ColorBuilders.ColorProp.Builder
```

<br />

*** ** * ** ***

Builder for[ColorProp](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorProp)

## Summary

|                                                                                                                                                                                                                                     ### Public constructors                                                                                                                                                                                                                                     |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ~~[Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorProp.Builder#Builder())~~`()` **This function is deprecated.** use[Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorProp.Builder#Builder(int)) <br />                                                                                                                                                                               |
| [Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorProp.Builder#Builder(int))`(staticValue: @`[ColorInt](https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Creates an instance of[Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorProp.Builder)from the given static value. |

|                                                            ### Public functions                                                             |
|---------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ColorBuilders.ColorProp](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorProp)                 | [build](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorProp.Builder#build())`()` Builds an instance from accumulated values.                                                                                                                                                                                                                                                                                                                                                                                                  |
| [ColorBuilders.ColorProp.Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorProp.Builder) | `@`[RequiresSchemaVersion](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion)`(major = 1, minor = 0)` [setArgb](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorProp.Builder#setArgb(int))`(argb: @`[ColorInt](https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Sets the static color value, in ARGB format.                                              |
| [ColorBuilders.ColorProp.Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorProp.Builder) | `@`[RequiresSchemaVersion](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion)`(major = 1, minor = 200)` [setDynamicValue](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorProp.Builder#setDynamicValue(androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor))`(dynamicValue: `[DynamicBuilders.DynamicColor](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor)`)` Sets the dynamic value. |

## Public constructors

### Builder

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

```
[Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorProp.Builder#Builder())()
```
| **This function is deprecated.**   
|
| use[Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorProp.Builder#Builder(int))

Creates an instance of[Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorProp.Builder).  

### Builder

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

```
Builder(staticValue: @ColorInt Int)
```

Creates an instance of[Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorProp.Builder)from the given static value.[setDynamicValue](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorProp.Builder#setDynamicValue(androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor))can be used to provide a dynamic value.  

## Public functions

### build

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

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

Builds an instance from accumulated values.  

|                                                     Throws                                                      |
|-----------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [java.lang.IllegalStateException](https://developer.android.com/reference/java/lang/IllegalStateException.html) | if a dynamic value is set using[setDynamicValue](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorProp.Builder#setDynamicValue(androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor))but neither[Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorProp.Builder#Builder(int))nor[setArgb](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorProp.Builder#setArgb(int))is used to provide a static value. |

### setArgb

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

```
@RequiresSchemaVersion(major = 1, minor = 0)
fun setArgb(argb: @ColorInt Int): ColorBuilders.ColorProp.Builder
```

Sets the static color value, in ARGB format. If a dynamic value is also set and the renderer supports dynamic values for the corresponding field, this static value will be ignored. If the static value is not specified, zero (equivalent to[TRANSPARENT](https://developer.android.com/reference/android/graphics/Color.html#TRANSPARENT())) will be used instead.  

### setDynamicValue

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

```
@RequiresSchemaVersion(major = 1, minor = 200)
fun setDynamicValue(dynamicValue: DynamicBuilders.DynamicColor): ColorBuilders.ColorProp.Builder
```

Sets the dynamic value. Note that when setting this value, the static value is still required to be set to support older renderers that only read the static value. If`dynamicValue`has an invalid result, the provided static value will be used instead.