# androidx.compose.ui.graphics.colorspace

Common/All

## Classes

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/Adaptation` | List of adaptation matrices that can be used for chromatic adaptation using the von Kries transform. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/ColorModel` | A color model is required by a `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/ColorSpace` to describe the way colors can be represented as tuples of numbers. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/ColorSpace` | A `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/ColorSpace` is used to identify a specific organization of colors. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/Connector` | A connector transforms colors from a source color space to a destination color space. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/RenderIntent` | A render intent determines how a `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/Connector` maps colors from one color space to another. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/Rgb` | An RGB color space is an additive color space using the `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/ColorModel#Rgb()` color model (a color is therefore represented by a tuple of 3 numbers). | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/TransferParameters` | Defines the parameters for the ICC parametric curve type 4, as defined in ICC.1:2004-10, section 10.15. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/WhitePoint` | Class for constructing white points used in `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/Rgb` color space. | Cmn |

## Objects

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/ColorSpaces` |   | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/Illuminant` | Illuminant contains standard CIE `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/WhitePoint`. | Cmn |

## Extension functions summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/ColorSpace` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/ColorSpace.https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/package-summary#(androidx.compose.ui.graphics.colorspace.ColorSpace).adapt(androidx.compose.ui.graphics.colorspace.WhitePoint,androidx.compose.ui.graphics.colorspace.Adaptation)(whitePoint: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/WhitePoint, adaptation: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/Adaptation)` Performs the chromatic adaptation of a color space from its native white point to the specified white point. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/Connector` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/ColorSpace.https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/package-summary#(androidx.compose.ui.graphics.colorspace.ColorSpace).connect(androidx.compose.ui.graphics.colorspace.ColorSpace,androidx.compose.ui.graphics.colorspace.RenderIntent)(destination: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/ColorSpace, intent: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/RenderIntent)` Connects two color spaces to allow conversion from the source color space to the destination color space. | Cmn |

## Extension functions

### ColorSpace.adapt

Cmn Artifact: [androidx.compose.ui:ui-graphics](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/graphics/colorspace/ColorSpace.kt+function:adapt) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun ColorSpace.adapt(
    whitePoint: WhitePoint,
    adaptation: Adaptation = Adaptation.Bradford
): ColorSpace
```

Performs the chromatic adaptation of a color space from its native white point to the specified white point. If the specified color space does not have an `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/ColorModel#Rgb()` color model, or if the color space already has the target white point, the color space is returned unmodified.

The chromatic adaptation is performed using the von Kries method described in the documentation of `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/Adaptation`.

| Parameters |
|---|---|
| `whitePoint: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/WhitePoint` | The new white point |
| `adaptation: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/Adaptation = Adaptation.Bradford` | The adaptation matrix |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/ColorSpace` | A new color space if the specified color space has an RGB model and a white point different from the specified white point; the specified color space otherwise |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/Adaptation` |   |

### ColorSpace.connect

Cmn Artifact: [androidx.compose.ui:ui-graphics](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/graphics/colorspace/ColorSpace.kt+function:connect) Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.10.0)

```
fun ColorSpace.connect(
    destination: ColorSpace = ColorSpaces.Srgb,
    intent: RenderIntent = RenderIntent.Perceptual
): Connector
```

Connects two color spaces to allow conversion from the source color space to the destination color space. If the source and destination color spaces do not have the same profile connection space (CIE XYZ with the same white point), they are chromatically adapted to use the CIE standard illuminant `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/Illuminant#D50()` as needed.

If the source and destination are the same, an optimized connector is returned to avoid unnecessary computations and loss of precision.

| Parameters |
|---|---|
| `destination: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/ColorSpace = ColorSpaces.Srgb` | The color space to convert colors to |
| `intent: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/RenderIntent = RenderIntent.Perceptual` | The render intent to map colors from the source to the destination |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/Connector` | A non-null connector between the two specified color spaces |