The Developer Preview for Android 11 is now available; test it out and share your feedback.

ColorModel

enum class ColorModel
kotlin.Any
   ↳ kotlin.Enum<androidx.ui.graphics.colorspace.ColorModel>
   ↳ androidx.ui.graphics.colorspace.ColorModel

A color model is required by a ColorSpace to describe the way colors can be represented as tuples of numbers. A common color model is the RGB color model which defines a color as represented by a tuple of 3 numbers (red, green and blue).

Summary

Enum values

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).

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

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

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

Inherited extension functions

From androidx.compose
operator T

IMPORTANT: This global operator is TEMPORARY, and should be removed whenever an answer for contextual composers is reached.

Properties

Int

Returns the number of components for this color model.

Enum values

Cmyk

enum 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

enum 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

enum val Rgb : ColorModel

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

Xyz

enum 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.

Properties

componentCount

val componentCount: Int

Returns the number of components for this color model.

Return
An integer between 1 and 4