# ColorModel

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/ColorModel.kt+class:androidx.compose.ui.graphics.colorspace.ColorModel) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Common/All
- Cmn

  ```
  value class 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. A common color model is the `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/ColorModel#Rgb()` color model which defines a color as represented by a tuple of 3 numbers (red, green and blue).

## Summary

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/ColorModel` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/ColorModel#Cmyk()` The CMYK model is a color model with 4 components that refer to four inks used in color printing: cyan, magenta, yellow and black (or key). | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/ColorModel` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/ColorModel#Lab()` The Lab model is a color model with 3 components used to describe a color space that is more perceptually uniform than XYZ. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/ColorModel` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/ColorModel#Rgb()` The RGB model is a color model with 3 components that refer to the three additive primiaries: red, green and blue. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/ColorModel` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/ColorModel#Xyz()` The XYZ model is a color model with 3 components that are used to model human color vision on a basic sensory level. | Cmn |

| ### Public functions |
|---|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/ColorModel#toString()()` | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/colorspace/ColorModel#componentCount()` Returns the number of components for this color model. | Cmn |

## Public companion properties

### Cmyk

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val Cmyk: ColorModel
```

The CMYK model is a color model with 4 components that refer to four inks used in color printing: cyan, magenta, yellow and black (or key). CMYK is a subtractive color model.

### Lab

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val Lab: ColorModel
```

The Lab model is a color model with 3 components used to describe a color space that is more perceptually uniform than XYZ.

### Rgb

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val Rgb: ColorModel
```

The RGB model is a color model with 3 components that refer to the three additive primiaries: red, green and blue.

### Xyz

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val Xyz: ColorModel
```

The XYZ model is a color model with 3 components that are used to model human color vision on a basic sensory level.

## Public functions

### toString

Cmn

```
open fun toString(): String
```

## Public properties

### componentCount

Cmn Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.2.0)

```
val componentCount: Int
```

Returns the number of components for this color model.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | An integer between 1 and 4 |