🌈 Create new beautiful Compose Gradients with our new wesite ->
Class

ColorModel

A color model is required by a ColorSpace to describe the way colors can be represented as tuples of numbers.

Source set: Common
public class ColorModel internal constructor(
    /**
     * pack both the number of components and an ordinal value to distinguish between different
     * ColorModel types that have the same number of components
     */
    internal val packedValue: Long
)

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

Properties

componentCount

Source set: Common
public val componentCount: Int

Returns the number of components for this color model.

Return

An integer between 1 and 4

Members

Companion

Source set: Common
public companion object

Properties

Rgb

Source set: Common
public 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

Source set: Common
public 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.

Lab

Source set: Common
public 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.

Cmyk

Source set: Common
public 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.