<div class='sourceset sourceset-android'>Android</div>

```kotlin
public open class RemoteColor
internal constructor(
    @get:Suppress("AutoBoxing") public override val constantValueOrNull: Color?,
    internal override val cacheKey: RemoteStateCacheKey,
    alpha: RemoteFloat?,
    red: RemoteFloat?,
    green: RemoteFloat?,
    blue: RemoteFloat?,
    internal val idProvider: (creationState: RemoteComposeCreationState) -> Int,
) : BaseRemoteState<Color>()
```

Represents a color that can be used with canvas APIs.

`RemoteColor` represents a color value that can be a constant, a named variable, or a dynamic
expression (e.g., a color interpolation).

## Secondary Constructors

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public constructor(
    alpha: RemoteFloat,
    red: RemoteFloat,
    green: RemoteFloat,
    blue: RemoteFloat,
) : this(
    constantValueOrNull = constantColorOrNull(alpha, red, green, blue),
    alpha = alpha,
    red = red,
    green = green,
    blue = blue,
    cacheKey = RemoteOperationCacheKey.create(OperationKey.FromArgb, alpha, red, green, blue),
    idProvider = { creationState ->
        creationState.getOrPutVariableId(
            RemoteOperationCacheKey.create(OperationKey.FromArgb, alpha, red, green, blue)
        ) {
            creationState.document
                .addColorExpression(
                    alpha.getFloatIdForCreationState(creationState),
                    red.getFloatIdForCreationState(creationState),
                    green.getFloatIdForCreationState(creationState),
                    blue.getFloatIdForCreationState(creationState),
                )
                .toInt()
        }
    },
)
```

```kotlin
internal constructor(
    cacheKey: RemoteStateCacheKey,
    idProvider: (creationState: RemoteComposeCreationState) -> Int,
) : this(
    constantValueOrNull = null,
    cacheKey = cacheKey,
    alpha = null,
    red = null,
    green = null,
    blue = null,
    idProvider = idProvider,
)
```

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public constructor(
    color: Color
) : this(
    constantValueOrNull = color,
    alpha = color.alpha.rf,
    red = color.red.rf,
    green = color.green.rf,
    blue = color.blue.rf,
    cacheKey = RemoteConstantCacheKey(color.toArgb()),
    idProvider = { creationState -> creationState.document.addColor(color.toArgb()) },
)
```

Constructor for creating a [RemoteColor](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteColor) from a [Color](/jetpack-compose/androidx.compose.ui/ui-graphics/classes/Color) value. This creates a constant remote
color that is added to the remote document.

#### Parameters

| | |
| --- | --- |
| color | The color value. |

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public constructor(@ColorInt color: Int) : this(Color(color))
```

Constructor for creating a [RemoteColor](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteColor) from a direct ARGB integer color value. This creates
a constant remote color that is added to the remote document.

#### Parameters

| | |
| --- | --- |
| color | The ARGB integer representation of the color. |

## Functions

<h2 id="times-other">times</h2>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public operator fun times(other: RemoteColor): RemoteColor
```

Computes the pairwise product of this [RemoteColor](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteColor) with `other`.

#### Parameters

| | |
| --- | --- |
| other | The [RemoteColor](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteColor) to multiply with this [RemoteColor](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteColor). |

#### Returns

| | |
| --- | --- |
|  | The result of multiplying [RemoteColor](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteColor) by `other`. |

<hr class="docs-overload-divider">

<h2 id="copy-alpha-red-green-blue">copy</h2>

```kotlin
public fun copy(
        alpha: RemoteFloat? = null,
        red: RemoteFloat? = null,
        green: RemoteFloat? = null,
        blue: RemoteFloat? = null,
    ): RemoteColor
```

Creates a copy of this [RemoteColor](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteColor) with the ability to override individual ARGB components.
If a component is not specified, it defaults to the corresponding component of the original
[RemoteColor](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteColor).

#### Parameters

| | |
| --- | --- |
| alpha | Optional [RemoteFloat](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteFloat) to override the alpha component. |
| red | Optional [RemoteFloat](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteFloat) to override the red component. |
| green | Optional [RemoteFloat](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteFloat) to override the green component. |
| blue | Optional [RemoteFloat](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteFloat) to override the blue component. |

#### Returns

| | |
| --- | --- |
|  | A new [RemoteColor](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteColor) with the specified components overridden. |

## Companion Object

#### Methods

<hr class="docs-overload-divider">

<h2 id="invoke-value">invoke</h2>

<div class='sourceset sourceset-android'>Android</div>

```kotlin
public operator fun invoke(value: Color): RemoteColor
```

Creates a [RemoteColor](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteColor) from a literal [Color](/jetpack-compose/androidx.compose.ui/ui-graphics/classes/Color) value.

#### Parameters

| | |
| --- | --- |
| value | The [Color](/jetpack-compose/androidx.compose.ui/ui-graphics/classes/Color) value. |

#### Returns

| | |
| --- | --- |
|  | A [RemoteColor](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteColor) representing the constant color. |

<hr class="docs-overload-divider">

<h2 id="createnamedremotecolor-name-defaultvalue-domain">createNamedRemoteColor</h2>

<div class='sourceset sourceset-android'>Android</div>

```kotlin
@JvmStatic
        public fun createNamedRemoteColor(
            name: String,
            defaultValue: Color,
            domain: RemoteState.Domain = RemoteState.Domain.User,
        ): RemoteColor
```

Creates a named [RemoteColor](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteColor) with an initial value.

Named remote colors can be set via AndroidRemoteContext.setNamedColor.

#### Parameters

| | |
| --- | --- |
| name | A unique name to identify this state within its `domain`. |
| defaultValue | The initial [Color](/jetpack-compose/androidx.compose.ui/ui-graphics/classes/Color) value for the named remote color. |
| domain | The domain for the named state. Defaults to [RemoteState.Domain.User](/jetpack-compose/androidx.compose.remote/remote-creation-compose/objects/RemoteState.Domain.User). |

#### Returns

| | |
| --- | --- |
|  | A [RemoteColor](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteColor) representing the named color. |

<hr class="docs-overload-divider">

<h2 id="hsv-hue-saturation-value-alpha">hsv</h2>

<div class='sourceset sourceset-android'>Android</div>

```kotlin
public fun hsv(
            hue: RemoteFloat,
            saturation: RemoteFloat,
            value: RemoteFloat,
            alpha: RemoteFloat = 1.rf,
        ): RemoteColor
```

Creates a [RemoteColor](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteColor) from remote `hue`, `saturation`, and `value` (brightness)
components. The resulting color is expressed as a [RemoteColor](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteColor) expression that combines
these inputs.

#### Parameters

| | |
| --- | --- |
| hue | A [RemoteFloat](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteFloat) representing the hue in the range [0..1]. |
| saturation | A [RemoteFloat](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteFloat) representing the saturation in the range [0..1]. |
| value | A [RemoteFloat](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteFloat) representing the brightness in the range [0..1]. |
| alpha | The fixed alpha value the range [0..1]. |

#### Returns

| | |
| --- | --- |
|  | A new [RemoteColor](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteColor) derived from the provided HSV components. |

<hr class="docs-overload-divider">

<h2 id="fromahsv-alpha-hue-saturation-value">fromAHSV</h2>

<div class='sourceset sourceset-android'>Android</div>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
        public fun fromAHSV(
            alpha: Int,
            hue: RemoteFloat,
            saturation: RemoteFloat,
            value: RemoteFloat,
        ): RemoteColor
```

Creates a [RemoteColor](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteColor) from a fixed alpha value and remote `hue`, `saturation`, and
`value` (brightness) components. This allows creating a remote color with a constant
opacity and dynamic HSV.

#### Parameters

| | |
| --- | --- |
| alpha | The fixed alpha value the range [0..255]. |
| hue | A [RemoteFloat](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteFloat) representing the hue in the range [0..1]. |
| saturation | A [RemoteFloat](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteFloat) representing the saturation in the range [0..1]. |
| value | A [RemoteFloat](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteFloat) representing the brightness in the range [0..1]. |

#### Returns

| | |
| --- | --- |
|  | A new [RemoteColor](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteColor) derived from the provided AHSV components. |

<hr class="docs-overload-divider">

<h2 id="rgb-red-green-blue-alpha">rgb</h2>

<div class='sourceset sourceset-android'>Android</div>

```kotlin
public fun rgb(
            red: RemoteFloat,
            green: RemoteFloat,
            blue: RemoteFloat,
            alpha: RemoteFloat = 1.rf,
        ): RemoteColor
```

Creates a [RemoteColor](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteColor) from remote [alpha](/jetpack-compose/androidx.compose.ui/ui/modifiers/alpha), `red`, `green`, and `blue` components.

#### Parameters

| | |
| --- | --- |
| alpha | [RemoteFloat](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteFloat) representing the alpha in the range [0..1]. |
| red | A [RemoteFloat](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteFloat) representing red in the range [0..1]. |
| green | A [RemoteFloat](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteFloat) representing green in the range [0..1]. |
| blue | A [RemoteFloat](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteFloat) representing blue in the range [0..1]. |

#### Returns

| | |
| --- | --- |
|  | A new [RemoteColor](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteColor) derived from the provided ARGB components. |

<hr class="docs-overload-divider">

<h2 id="rgb-alpha-red-green-blue">rgb</h2>

<div class='sourceset sourceset-android'>Android</div>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
        public fun rgb(alpha: Float, red: Float, green: Float, blue: Float): RemoteColor
```

Creates a [RemoteColor](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteColor) from [alpha](/jetpack-compose/androidx.compose.ui/ui/modifiers/alpha), `red`, `green`, and `blue` components.

#### Parameters

| | |
| --- | --- |
| alpha | `Float` representing the alpha in the range [0..1]. |
| red | A `Float` representing red in the range [0..1]. |
| green | A `Float` representing green in the range [0..1]. |
| blue | A `Float` representing blue in the range [0..1]. |

#### Returns

| | |
| --- | --- |
|  | A new [RemoteColor](/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteColor) derived from the provided ARGB components. |