# ColorSpace.Model

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# Model

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/graphics/ColorSpace.Model "View this page in Java")  

```
class Model
```

|---|---|------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                            |||
| ↳ | [kotlin.Enum](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html)\<[android.graphics.ColorSpace.Model](https://developer.android.com/reference/kotlin/android/graphics/ColorSpace.Model#)\> ||
|   | ↳ | [android.graphics.ColorSpace.Model](https://developer.android.com/reference/kotlin/android/graphics/ColorSpace.Model#) |

|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known Direct Subclasses [ColorSpace.Model.CMYK](https://developer.android.com/reference/kotlin/android/graphics/ColorSpace.Model#ENUM_VALUE:CMYK),[ColorSpace.Model.LAB](https://developer.android.com/reference/kotlin/android/graphics/ColorSpace.Model#ENUM_VALUE:LAB),[ColorSpace.Model.RGB](https://developer.android.com/reference/kotlin/android/graphics/ColorSpace.Model#ENUM_VALUE:RGB),[ColorSpace.Model.XYZ](https://developer.android.com/reference/kotlin/android/graphics/ColorSpace.Model#ENUM_VALUE:XYZ) |---------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------| | [ColorSpace.Model.CMYK](https://developer.android.com/reference/kotlin/android/graphics/ColorSpace.Model#ENUM_VALUE: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). | | [ColorSpace.Model.LAB](https://developer.android.com/reference/kotlin/android/graphics/ColorSpace.Model#ENUM_VALUE:LAB)   | The Lab model is a color model with 3 components used to describe a color space that is more perceptually uniform than XYZ.                 | | [ColorSpace.Model.RGB](https://developer.android.com/reference/kotlin/android/graphics/ColorSpace.Model#ENUM_VALUE:RGB)   | The RGB model is a color model with 3 components that refer to the three additive primaries: red, green and blue.                           | | [ColorSpace.Model.XYZ](https://developer.android.com/reference/kotlin/android/graphics/ColorSpace.Model#ENUM_VALUE:XYZ)   | The XYZ model is a color model with 3 components that are used to model human color vision on a basic sensory level.                        | |

A color model is required by a[ColorSpace](https://developer.android.com/reference/kotlin/android/graphics/ColorSpace)to describe the way colors can be represented as tuples of numbers. A common color model is the[RGB](https://developer.android.com/reference/kotlin/android/graphics/ColorSpace.Model#)color model which defines a color as represented by a tuple of 3 numbers (red, green and blue).

## Summary

|                                                                                                                       Enum values                                                                                                                       ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [CMYK](https://developer.android.com/reference/kotlin/android/graphics/ColorSpace.Model#ENUM_VALUE: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). |
| [LAB](https://developer.android.com/reference/kotlin/android/graphics/ColorSpace.Model#ENUM_VALUE:LAB) The Lab model is a color model with 3 components used to describe a color space that is more perceptually uniform than XYZ.                   |
| [RGB](https://developer.android.com/reference/kotlin/android/graphics/ColorSpace.Model#ENUM_VALUE:RGB) The RGB model is a color model with 3 components that refer to the three additive primaries: red, green and blue.                             |
| [XYZ](https://developer.android.com/reference/kotlin/android/graphics/ColorSpace.Model#ENUM_VALUE:XYZ) The XYZ model is a color model with 3 components that are used to model human color vision on a basic sensory level.                          |

|                                                                                                                          Public methods                                                                                                                          ||
|----------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getComponentCount](https://developer.android.com/reference/kotlin/android/graphics/ColorSpace.Model#getComponentCount())`()` Returns the number of components for this color model. |

## Enum values

### CMYK

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
enum val CMYK : ColorSpace.Model
```

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

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
enum val LAB : ColorSpace.Model
```

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

### RGB

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
enum val RGB : ColorSpace.Model
```

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

### XYZ

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
enum val XYZ : ColorSpace.Model
```

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

## Public methods

### getComponentCount

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getComponentCount(): Int
```

Returns the number of components for this color model.

|                                                                  Return                                                                   ||
|----------------------------------------------------------------------------|---------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | An integer between 1 and 4 Value is between 1 and 4 inclusive |