# DynamicBuilders.DynamicColor

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

*** ** * ** ***

<br />

```
@RequiresSchemaVersion(major = 1, minor = 200)
interface DynamicBuilders.DynamicColor : DynamicBuilders.DynamicType
```

<br />

*** ** * ** ***

Interface defining a dynamic color type.

## Summary

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` | `@https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor#animate()()` Returns a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` that is bound to the value of this `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` and every time its value is changing, it animates from its current value to the new value. |
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` | `@https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor#animate(androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec)(animationSpec: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/AnimationParameterBuilders.AnimationSpec)` Returns a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` that is bound to the value of this `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` and every time its value is changing, it animates from its current value to the new value. |
| `java-static https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` | `@https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor#animate(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor>)(dynamicDataKey: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicDataKey<https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor!>)` Creates a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` that is bound to the value of an item of the State. |
| `java-static https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` | `@https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor#animate(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor>,androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec)( dynamicDataKey: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicDataKey<https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor!>, animationSpec: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/AnimationParameterBuilders.AnimationSpec )` Creates a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` that is bound to the value of an item of the State. |
| `java-static https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` | `@https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor#animate(int,int)(start: @https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, end: @https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Creates a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` which will animate over the range of colors from ` start` to `end`. |
| `java-static https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` | `@https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor#animate(int,int,androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec)( start: @https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, end: @https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, animationSpec: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/AnimationParameterBuilders.AnimationSpec )` Creates a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` which will animate over the range of colors from ` start` to `end` with the given animation parameters. |
| `java-static https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` | `@https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor#constant(int)(constant: @https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Creates a constant-valued `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor`. |
| `java-static https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` | `@https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor#from(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor>)(dynamicDataKey: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicDataKey<https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor!>)` Creates a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` that is bound to the value of an item of the State. |
| `java-static https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` | `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor#fromByteArray(byte[])(byteArray: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>)` Creates a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` from a byte array generated by `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor#toDynamicColorByteArray()`. |
| `java-static https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` | `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor#fromByteArray(byte[],int,int)(byteArray: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>, offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, length: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Creates a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` from the provided byte array at the provided offset and length, that was generated by one of the `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor#toDynamicColorByteArray()` overloads. |
| `java-static https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/ConditionScopes.ConditionScope<https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor!, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html!>` | `@https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor#onCondition(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool)(condition: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool)` Bind the value of this `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` to the result of a conditional expression. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>` | `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor#toDynamicColorByteArray()()` Serializes the `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` into a new byte array that can later be used with `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor#fromByteArray(byte[])`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor#toDynamicColorByteArray(byte[])(byteArray: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>)` Serializes the `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` into the provided byte array, returning the amount of bytes written, that can later be used with `DynamicColor.fromByteArray(byteArray, 0, bytesWritten)`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor#toDynamicColorByteArray(byte[],int,int)( byteArray: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>, offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, length: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Serializes the `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` into the provided byte array, returning the amount of bytes written, limited by the provided offset and length, that can later be used with `DynamicColor.fromByteArray(byteArray, offset, bytesWritten)`. |

| ### Extension functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/types/LayoutColor` | `@https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor.https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor#(androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor).asLayoutColor(kotlin.Int)(staticArgb: @https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Extension for creating a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/types/LayoutColor` from a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` |
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/types/LayoutColor` | `@https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor.https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor#(androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor).asLayoutColor(kotlin.Long)(staticArgb: @https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Extension for creating a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/types/LayoutColor` from a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` |

## Public functions

### animate

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

```
@RequiresSchemaVersion(major = 1, minor = 200)
fun animate(): DynamicBuilders.DynamicColor
```

Returns a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` that is bound to the value of this `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` and every time its value is changing, it animates from its current value to the new value.

### animate

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

```
@RequiresSchemaVersion(major = 1, minor = 200)
fun animate(animationSpec: AnimationParameterBuilders.AnimationSpec): DynamicBuilders.DynamicColor
```

Returns a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` that is bound to the value of this `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` and every time its value is changing, it animates from its current value to the new value.

| Parameters |
|---|---|
| `animationSpec: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/AnimationParameterBuilders.AnimationSpec` | The animation parameters. |

### animate

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

```
@RequiresSchemaVersion(major = 1, minor = 200)
java-static fun animate(dynamicDataKey: DynamicDataKey<DynamicBuilders.DynamicColor!>): DynamicBuilders.DynamicColor
```

Creates a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` that is bound to the value of an item of the State. Every time the state value changes, this `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` will animate from its current value to the new value (from the state).

| Parameters |
|---|---|
| `dynamicDataKey: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicDataKey<https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor!>` | The source key to a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicDataBuilders.DynamicDataValue` with a color value. |

### animate

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

```
@RequiresSchemaVersion(major = 1, minor = 200)
java-static fun animate(
    dynamicDataKey: DynamicDataKey<DynamicBuilders.DynamicColor!>,
    animationSpec: AnimationParameterBuilders.AnimationSpec
): DynamicBuilders.DynamicColor
```

Creates a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` that is bound to the value of an item of the State. Every time the state value changes, this `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` will animate from its current value to the new value (from the state).

| Parameters |
|---|---|
| `dynamicDataKey: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicDataKey<https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor!>` | The source key to a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicDataBuilders.DynamicDataValue` with a color value. |
| `animationSpec: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/AnimationParameterBuilders.AnimationSpec` | The animation parameters. |

### animate

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

```
@RequiresSchemaVersion(major = 1, minor = 200)
java-static fun animate(start: @ColorInt Int, end: @ColorInt Int): DynamicBuilders.DynamicColor
```

Creates a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` which will animate over the range of colors from ` start` to `end`.

| Parameters |
|---|---|
| `start: @https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The start value of the range. |
| `end: @https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The end value of the range. |

### animate

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

```
@RequiresSchemaVersion(major = 1, minor = 200)
java-static fun animate(
    start: @ColorInt Int,
    end: @ColorInt Int,
    animationSpec: AnimationParameterBuilders.AnimationSpec
): DynamicBuilders.DynamicColor
```

Creates a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` which will animate over the range of colors from ` start` to `end` with the given animation parameters.

| Parameters |
|---|---|
| `start: @https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The start value of the range. |
| `end: @https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The end value of the range. |
| `animationSpec: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/AnimationParameterBuilders.AnimationSpec` | The animation parameters. |

### constant

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

```
@RequiresSchemaVersion(major = 1, minor = 200)
java-static fun constant(constant: @ColorInt Int): DynamicBuilders.DynamicColor
```

Creates a constant-valued `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor`.

### from

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

```
@RequiresSchemaVersion(major = 1, minor = 200)
java-static fun from(dynamicDataKey: DynamicDataKey<DynamicBuilders.DynamicColor!>): DynamicBuilders.DynamicColor
```

Creates a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` that is bound to the value of an item of the State.

| Parameters |
|---|---|
| `dynamicDataKey: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicDataKey<https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor!>` | The source key to a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicDataBuilders.DynamicDataValue` with a color value. |

### fromByteArray

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

```
java-static fun fromByteArray(byteArray: ByteArray<Byte>): DynamicBuilders.DynamicColor
```

Creates a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` from a byte array generated by `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor#toDynamicColorByteArray()`.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if the byte array does not contain a valid serialization |

### fromByteArray

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

```
java-static fun fromByteArray(byteArray: ByteArray<Byte>, offset: Int, length: Int): DynamicBuilders.DynamicColor
```

Creates a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` from the provided byte array at the provided offset and length, that was generated by one of the `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor#toDynamicColorByteArray()` overloads.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if the byte array does not contain a valid serialization in the provided offset and length |

### onCondition

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

```
@RequiresSchemaVersion(major = 1, minor = 200)
java-static fun onCondition(condition: DynamicBuilders.DynamicBool): ConditionScopes.ConditionScope<DynamicBuilders.DynamicColor!, Int!>
```

Bind the value of this `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` to the result of a conditional expression. This will use the value given in either `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/ConditionScopes.ConditionScope#use(T)` or `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/ConditionScopes.IfTrueScope#elseUse(T)` depending on the value yielded from ` condition`.

### toDynamicColorByteArray

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

```
fun toDynamicColorByteArray(): Array<Byte>
```

Serializes the `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` into a new byte array that can later be used with `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor#fromByteArray(byte[])`.

### toDynamicColorByteArray

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

```
fun toDynamicColorByteArray(byteArray: ByteArray<Byte>): Int
```

Serializes the `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` into the provided byte array, returning the amount of bytes written, that can later be used with `DynamicColor.fromByteArray(byteArray, 0, bytesWritten)`.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if the byte array is too small |

### toDynamicColorByteArray

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

```
fun toDynamicColorByteArray(
    byteArray: ByteArray<Byte>,
    offset: Int,
    length: Int
): Int
```

Serializes the `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor` into the provided byte array, returning the amount of bytes written, limited by the provided offset and length, that can later be used with `DynamicColor.fromByteArray(byteArray, offset, bytesWritten)`.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if the byte array is too small |

## Extension functions

### DynamicBuilders.DynamicColor.asLayoutColor

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/types/LayoutColor.kt+function:asLayoutColor)

```
@RequiresSchemaVersion(major = 1, minor = 200)
fun DynamicBuilders.DynamicColor.asLayoutColor(staticArgb: @ColorInt Int): LayoutColor
```

Extension for creating a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/types/LayoutColor` from a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor`

| Parameters |
|---|---|
| `staticArgb: @https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the static value that can be used when the `dynamicValue` can't be resolved. |

### DynamicBuilders.DynamicColor.asLayoutColor

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/types/LayoutColor.kt+function:asLayoutColor)

```
@RequiresSchemaVersion(major = 1, minor = 200)
fun DynamicBuilders.DynamicColor.asLayoutColor(staticArgb: @ColorInt Long): LayoutColor
```

Extension for creating a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/types/LayoutColor` from a `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicColor`

| Parameters |
|---|---|
| `staticArgb: @https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | the static value that can be used when the `dynamicValue` can't be resolved. |