Stay organized with collections
Save and categorize content based on your preferences.
Model
class Model
Known Direct Subclasses
ColorSpace.Model.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 |
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 |
The RGB model is a color model with 3 components that refer to the three additive primaries: red, green and blue.
|
ColorSpace.Model.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
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 primaries: red, green and blue.
|
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 |
Returns the number of components for this color model.
|
Enum values
CMYK
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
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
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
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
fun getComponentCount(): Int
Returns the number of components for this color model.
Return |
Int |
An integer between 1 and 4 Value is between 1 and 4 inclusive |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# ColorSpace.Model\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nModel\n=====\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/graphics/ColorSpace.Model \"View this page in Java\") \n\n```\nclass Model\n```\n\n|---|---|----------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||\n| ↳ | [kotlin.Enum](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html)\\\u003c[android.graphics.ColorSpace.Model](#)\\\u003e ||\n| | ↳ | [android.graphics.ColorSpace.Model](#) |\n\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [ColorSpace.Model.CMYK](#ENUM_VALUE:CMYK), [ColorSpace.Model.LAB](#ENUM_VALUE:LAB), [ColorSpace.Model.RGB](#ENUM_VALUE:RGB), [ColorSpace.Model.XYZ](#ENUM_VALUE:XYZ) |-------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------| | [ColorSpace.Model.CMYK](#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](#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](#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](#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. | |\n\nA color model is required by a [ColorSpace](/reference/kotlin/android/graphics/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).\n\nSummary\n-------\n\n| Enum values ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [CMYK](#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). |\n| [LAB](#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. |\n| [RGB](#ENUM_VALUE:RGB) The RGB model is a color model with 3 components that refer to the three additive primaries: red, green and blue. |\n| [XYZ](#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. |\n\n| Public methods ||\n|----------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getComponentCount](#getComponentCount())`()` Returns the number of components for this color model. |\n\nEnum values\n-----------\n\n### CMYK\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val CMYK : ColorSpace.Model\n```\n\nThe 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. \n\n### LAB\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val LAB : ColorSpace.Model\n```\n\nThe Lab model is a color model with 3 components used to describe a color space that is more perceptually uniform than XYZ. \n\n### RGB\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val RGB : ColorSpace.Model\n```\n\nThe RGB model is a color model with 3 components that refer to the three additive primaries: red, green and blue. \n\n### XYZ\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val XYZ : ColorSpace.Model\n```\n\nThe XYZ model is a color model with 3 components that are used to model human color vision on a basic sensory level.\n\nPublic methods\n--------------\n\n### getComponentCount\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getComponentCount(): Int\n```\n\nReturns the number of components for this color model.\n\n| Return ||\n|----------------------------------------------------------------------------|---------------------------------------------------------------|\n| [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 |"]]