# toConstantColor

> Converts this [RemoteColor] to a [Color] if it has a constant value.

## API Reference

### toConstantColor

> Source set: Android

```kotlin
@Stable public fun RemoteColor.toConstantColor(): Color
```

Converts this [RemoteColor](https://composables.com/jetpack-compose/androidx.compose.remote/remote-creation-compose/functions/RemoteColor/api.md) to a `Color` if it has a constant value.

#### Return

the constant [Color](https://composables.com/jetpack-compose/androidx.compose.ui/ui-graphics/functions/Color/api.md) value of this [RemoteColor](https://composables.com/jetpack-compose/androidx.compose.remote/remote-creation-compose/functions/RemoteColor/api.md)

#### Throws: IllegalStateException

if this state does not have a constant value.
