Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#nestedclasses) \| [Inherited Constants](https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#inhconstants) \| [Inherited Fields](https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#inhfields) \| [Ctors](https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#pubctors) \| [Methods](https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#inhmethods)

# ColorSpace.Rgb

*** ** * ** ***

` public static class ColorSpace.Rgb `   
` ` ` extends https://developer.android.com/reference/android/graphics/ColorSpace ` ` `

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||
| ↳ | [android.graphics.ColorSpace](https://developer.android.com/reference/android/graphics/ColorSpace) ||
|   | ↳ | android.graphics.ColorSpace.Rgb |

<br />

*** ** * ** ***


An RGB color space is an additive color space using the `https://developer.android.com/reference/android/graphics/ColorSpace.Model#RGB` color model (a color is therefore represented by a tuple of 3 numbers).

A specific RGB color space is defined by the following properties:

- Three chromaticities of the red, green and blue primaries, which define the gamut of the color space.
- A white point chromaticity that defines the stimulus to which color space values are normalized (also just called "white").
- An opto-electronic transfer function, also called opto-electronic conversion function or often, and approximately, gamma function.
- An electro-optical transfer function, also called electo-optical conversion function or often, and approximately, gamma function.
- A range of valid RGB values (most commonly \\(\[0..1\]\\)).

The most commonly used RGB color space is `https://developer.android.com/reference/android/graphics/ColorSpace.Named#SRGB`.

### Primaries and white point chromaticities

In this implementation, the chromaticity of the primaries and the white point of an RGB color space is defined in the CIE xyY color space. This color space separates the chromaticity of a color, the x and y components, and its luminance, the Y component. Since the primaries and the white point have full brightness, the Y component is assumed to be 1 and only the x and y components are needed to encode them.

For convenience, this implementation also allows to define the primaries and white point in the CIE XYZ space. The tristimulus XYZ values are internally converted to xyY.

![](https://developer.android.com/static/reference/android/images/graphics/colorspace_srgb.png)
sRGB primaries and white point

<br />

### Transfer functions

A transfer function is a color component conversion function, defined as a single variable, monotonic mathematical function. It is applied to each individual component of a color. They are used to perform the mapping between linear tristimulus values and non-linear electronic signal value.

The *opto-electronic transfer function* (OETF or OECF) encodes tristimulus values in a scene to a non-linear electronic signal value. An OETF is often expressed as a power function with an exponent between 0.38 and 0.55 (the reciprocal of 1.8 to 2.6).

The *electro-optical transfer function* (EOTF or EOCF) decodes a non-linear electronic signal value to a tristimulus value at the display. An EOTF is often expressed as a power function with an exponent between 1.8 and 2.6.

Transfer functions are used as a compression scheme. For instance, linear sRGB values would normally require 11 to 12 bits of precision to store all values that can be perceived by the human eye. When encoding sRGB values using the appropriate OETF (see `https://developer.android.com/reference/android/graphics/ColorSpace.Named#SRGB` for an exact mathematical description of that OETF), the values can be compressed to only 8 bits precision.

When manipulating RGB values, particularly sRGB values, it is safe to assume that these values have been encoded with the appropriate OETF (unless noted otherwise). Encoded values are often said to be in "gamma space". They are therefore defined in a non-linear space. This in turns means that any linear operation applied to these values is going to yield mathematically incorrect results (any linear interpolation such as gradient generation for instance, most image processing functions such as blurs, etc.).

To properly process encoded RGB values you must first apply the EOTF to decode the value into linear space. After processing, the RGB value must be encoded back to non-linear ("gamma") space. Here is a formal description of the process, where \\(f\\) is the processing function to apply:
$$RGB_{out} = OETF(f(EOTF(RGB_{in})))$$

If the transfer functions of the color space can be expressed as an ICC parametric curve as defined in ICC.1:2004-10, the numeric parameters can be retrieved by calling `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getTransferParameters()`. This can be useful to match color spaces for instance.

Some RGB color spaces, such as `https://developer.android.com/reference/android/graphics/ColorSpace.Named#ACES` and `https://developer.android.com/reference/android/graphics/ColorSpace.Named#LINEAR_EXTENDED_SRGB`, are said to be linear because their transfer functions are the identity function: \\(f(x) = x\\). If the source and/or destination are known to be linear, it is not necessary to invoke the transfer functions.

### Range

Most RGB color spaces allow RGB values in the range \\(\[0..1\]\\). There are however a few RGB color spaces that allow much larger ranges. For instance, `https://developer.android.com/reference/android/graphics/ColorSpace.Named#EXTENDED_SRGB` is used to manipulate the range \\(\[-0.5..7.5\]\\) while `https://developer.android.com/reference/android/graphics/ColorSpace.Named#ACES` can be used throughout the range \\(\[-65504, 65504\]\\).

![](https://developer.android.com/static/reference/android/images/graphics/colorspace_scrgb.png)
Extended sRGB and its large range

<br />

### Converting between RGB color spaces

Conversion between two color spaces is achieved by using an intermediate color space called the profile connection space (PCS). The PCS used by this implementation is CIE XYZ. The conversion operation is defined as such:
$$RGB_{out} = OETF(T_{dst}\^{-1} \\cdot T_{src} \\cdot EOTF(RGB_{in}))$$

Where \\(T_{src}\\) is the `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getTransform()` of the source color space and \\(T_{dst}\^{-1}\\) the `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getInverseTransform()` of the destination color space.

Many RGB color spaces commonly used with electronic devices use the standard illuminant `https://developer.android.com/reference/android/graphics/ColorSpace#ILLUMINANT_D65`. Care must be take however when converting between two RGB color spaces if their white points do not match. This can be achieved by either calling `https://developer.android.com/reference/android/graphics/ColorSpace#adapt(android.graphics.ColorSpace,%20float[])` to adapt one or both color spaces to a single common white point. This can be achieved automatically by calling `https://developer.android.com/reference/android/graphics/ColorSpace#connect(android.graphics.ColorSpace,%20android.graphics.ColorSpace)`, which also handles non-RGB color spaces.

To learn more about the white point adaptation process, refer to the documentation of `https://developer.android.com/reference/android/graphics/ColorSpace.Adaptation`.

<br />

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb.TransferParameters` Defines the parameters for the ICC parametric curve type 4, as defined in ICC.1:2004-10, section 10.15. |

### Inherited constants

From class `https://developer.android.com/reference/android/graphics/ColorSpace` `int` `https://developer.android.com/reference/android/graphics/ColorSpace#MAX_ID`

The maximum ID value a color space can have.
`int` `https://developer.android.com/reference/android/graphics/ColorSpace#MIN_ID`

The minimum ID value a color space can have.

### Inherited fields

From class `https://developer.android.com/reference/android/graphics/ColorSpace` ` public static final float[]` `https://developer.android.com/reference/android/graphics/ColorSpace#ILLUMINANT_A`

Standard CIE 1931 2° illuminant A, encoded in xyY.
` public static final float[]` `https://developer.android.com/reference/android/graphics/ColorSpace#ILLUMINANT_B`

Standard CIE 1931 2° illuminant B, encoded in xyY.
` public static final float[]` `https://developer.android.com/reference/android/graphics/ColorSpace#ILLUMINANT_C`

Standard CIE 1931 2° illuminant C, encoded in xyY.
` public static final float[]` `https://developer.android.com/reference/android/graphics/ColorSpace#ILLUMINANT_D50`

Standard CIE 1931 2° illuminant D50, encoded in xyY.
` public static final float[]` `https://developer.android.com/reference/android/graphics/ColorSpace#ILLUMINANT_D55`

Standard CIE 1931 2° illuminant D55, encoded in xyY.
` public static final float[]` `https://developer.android.com/reference/android/graphics/ColorSpace#ILLUMINANT_D60`

Standard CIE 1931 2° illuminant D60, encoded in xyY.
` public static final float[]` `https://developer.android.com/reference/android/graphics/ColorSpace#ILLUMINANT_D65`

Standard CIE 1931 2° illuminant D65, encoded in xyY.
` public static final float[]` `https://developer.android.com/reference/android/graphics/ColorSpace#ILLUMINANT_D75`

Standard CIE 1931 2° illuminant D75, encoded in xyY.
` public static final float[]` `https://developer.android.com/reference/android/graphics/ColorSpace#ILLUMINANT_E`

Standard CIE 1931 2° illuminant E, encoded in xyY.

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#Rgb(java.lang.String,%20float[],%20android.graphics.ColorSpace.Rgb.TransferParameters)(https://developer.android.com/reference/java/lang/String name, float[] toXYZ, https://developer.android.com/reference/android/graphics/ColorSpace.Rgb.TransferParameters function) ` <br /> Creates a new RGB color space using a 3x3 column-major transform matrix. |
| ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#Rgb(java.lang.String,%20float[],%20double)(https://developer.android.com/reference/java/lang/String name, float[] toXYZ, double gamma) ` <br /> Creates a new RGB color space using a 3x3 column-major transform matrix. |
| ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#Rgb(java.lang.String,%20float[],%20float[],%20android.graphics.ColorSpace.Rgb.TransferParameters)(https://developer.android.com/reference/java/lang/String name, float[] primaries, float[] whitePoint, https://developer.android.com/reference/android/graphics/ColorSpace.Rgb.TransferParameters function) ` <br /> Creates a new RGB color space using a specified set of primaries and a specified white point. |
| ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#Rgb(java.lang.String,%20float[],%20float[],%20double)(https://developer.android.com/reference/java/lang/String name, float[] primaries, float[] whitePoint, double gamma) ` <br /> Creates a new RGB color space using a specified set of primaries and a specified white point. |
| ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#Rgb(java.lang.String,%20float[],%20float[],%20java.util.function.DoubleUnaryOperator,%20java.util.function.DoubleUnaryOperator,%20float,%20float)(https://developer.android.com/reference/java/lang/String name, float[] primaries, float[] whitePoint, https://developer.android.com/reference/java/util/function/DoubleUnaryOperator oetf, https://developer.android.com/reference/java/util/function/DoubleUnaryOperator eotf, float min, float max) ` <br /> Creates a new RGB color space using a specified set of primaries and a specified white point. |
| ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#Rgb(java.lang.String,%20float[],%20java.util.function.DoubleUnaryOperator,%20java.util.function.DoubleUnaryOperator)(https://developer.android.com/reference/java/lang/String name, float[] toXYZ, https://developer.android.com/reference/java/util/function/DoubleUnaryOperator oetf, https://developer.android.com/reference/java/util/function/DoubleUnaryOperator eotf) ` <br /> Creates a new RGB color space using a 3x3 column-major transform matrix. |

| ### Public methods ||
|---|---|
| ` boolean` | ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object o) ` Indicates whether some other object is "equal to" this one. |
| ` float[]` | ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#fromLinear(float[])(float[] v) ` <br /> Encodes an RGB value from linear space to this color space's "gamma space". |
| ` float[]` | ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#fromLinear(float,%20float,%20float)(float r, float g, float b) ` <br /> Encodes an RGB value from linear space to this color space's "gamma space". |
| ` float[]` | ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#fromXyz(float[])(float[] v) ` <br /> Converts tristimulus values from the CIE XYZ space to this color space's color model. |
| ` https://developer.android.com/reference/java/util/function/DoubleUnaryOperator` | ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getEotf()() ` <br /> Returns the electro-optical transfer function (EOTF) of this color space. |
| ` float[]` | ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getInverseTransform(float[])(float[] inverseTransform) ` <br /> Copies the inverse transform of this color space in specified array. |
| ` float[]` | ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getInverseTransform()() ` <br /> Returns the inverse transform of this color space as a new array. |
| ` float` | ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getMaxValue(int)(int component) ` Returns the maximum valid value for the specified component of this color space's color model. |
| ` float` | ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getMinValue(int)(int component) ` Returns the minimum valid value for the specified component of this color space's color model. |
| ` https://developer.android.com/reference/java/util/function/DoubleUnaryOperator` | ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getOetf()() ` <br /> Returns the opto-electronic transfer function (OETF) of this color space. |
| ` float[]` | ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getPrimaries(float[])(float[] primaries) ` Copies the primaries of this color space in specified array. |
| ` float[]` | ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getPrimaries()() ` Returns the primaries of this color space as a new array of 6 floats. |
| ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb.TransferParameters` | ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getTransferParameters()() ` <br /> Returns the parameters used by the `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getEotf()` and `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getOetf()` transfer functions. |
| ` float[]` | ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getTransform()() ` <br /> Returns the transform of this color space as a new array. |
| ` float[]` | ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getTransform(float[])(float[] transform) ` <br /> Copies the transform of this color space in specified array. |
| ` float[]` | ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getWhitePoint()() ` Returns the non-adapted CIE xyY white point of this color space as a new array of 2 floats. |
| ` float[]` | ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getWhitePoint(float[])(float[] whitePoint) ` Copies the non-adapted CIE xyY white point of this color space in specified array. |
| ` int` | ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#hashCode()() ` Returns a hash code value for the object. |
| ` boolean` | ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#isSrgb()() ` <br /> Indicates whether this color space is the sRGB color space or equivalent to the sRGB color space. |
| ` boolean` | ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#isWideGamut()() ` Returns whether this color space is a wide-gamut color space. |
| ` float[]` | ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#toLinear(float[])(float[] v) ` <br /> Decodes an RGB value to linear space. |
| ` float[]` | ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#toLinear(float,%20float,%20float)(float r, float g, float b) ` <br /> Decodes an RGB value to linear space. |
| ` float[]` | ` https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#toXyz(float[])(float[] v) ` <br /> Converts a color value from this color space's model to tristimulus CIE XYZ values. |

### Inherited methods

From class ` https://developer.android.com/reference/android/graphics/ColorSpace ` ` static https://developer.android.com/reference/android/graphics/ColorSpace` ` https://developer.android.com/reference/android/graphics/ColorSpace#adapt(android.graphics.ColorSpace,%20float[],%20android.graphics.ColorSpace.Adaptation)(https://developer.android.com/reference/android/graphics/ColorSpace colorSpace, float[] whitePoint, https://developer.android.com/reference/android/graphics/ColorSpace.Adaptation adaptation) `

<br />

Performs the chromatic adaptation of a color space from its native white point to the specified white point.
` static https://developer.android.com/reference/android/graphics/ColorSpace` ` https://developer.android.com/reference/android/graphics/ColorSpace#adapt(android.graphics.ColorSpace,%20float[])(https://developer.android.com/reference/android/graphics/ColorSpace colorSpace, float[] whitePoint) `

<br />

Performs the chromatic adaptation of a color space from its native white point to the specified white point.
` static float[]` ` https://developer.android.com/reference/android/graphics/ColorSpace#cctToXyz(int)(int cct) `

<br />

Computes the chromaticity coordinates of a specified correlated color temperature (CCT) on the Planckian locus.
` static float[]` ` https://developer.android.com/reference/android/graphics/ColorSpace#chromaticAdaptation(android.graphics.ColorSpace.Adaptation,%20float[],%20float[])(https://developer.android.com/reference/android/graphics/ColorSpace.Adaptation adaptation, float[] srcWhitePoint, float[] dstWhitePoint) `

<br />

Computes the chromatic adaptation transform from the specified source white point to the specified destination white point.
` static https://developer.android.com/reference/android/graphics/ColorSpace.Connector` ` https://developer.android.com/reference/android/graphics/ColorSpace#connect(android.graphics.ColorSpace,%20android.graphics.ColorSpace.RenderIntent)(https://developer.android.com/reference/android/graphics/ColorSpace source, https://developer.android.com/reference/android/graphics/ColorSpace.RenderIntent intent) `

<br />

Connects the specified color spaces to sRGB.
` static https://developer.android.com/reference/android/graphics/ColorSpace.Connector` ` https://developer.android.com/reference/android/graphics/ColorSpace#connect(android.graphics.ColorSpace)(https://developer.android.com/reference/android/graphics/ColorSpace source) `

<br />

Connects the specified color spaces to sRGB.
` static https://developer.android.com/reference/android/graphics/ColorSpace.Connector` ` https://developer.android.com/reference/android/graphics/ColorSpace#connect(android.graphics.ColorSpace,%20android.graphics.ColorSpace,%20android.graphics.ColorSpace.RenderIntent)(https://developer.android.com/reference/android/graphics/ColorSpace source, https://developer.android.com/reference/android/graphics/ColorSpace destination, https://developer.android.com/reference/android/graphics/ColorSpace.RenderIntent intent) `

<br />

Connects two color spaces to allow conversion from the source color space to the destination color space.
` static https://developer.android.com/reference/android/graphics/ColorSpace.Connector` ` https://developer.android.com/reference/android/graphics/ColorSpace#connect(android.graphics.ColorSpace,%20android.graphics.ColorSpace)(https://developer.android.com/reference/android/graphics/ColorSpace source, https://developer.android.com/reference/android/graphics/ColorSpace destination) `

<br />

Connects two color spaces to allow conversion from the source color space to the destination color space.
` boolean` ` https://developer.android.com/reference/android/graphics/ColorSpace#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object o) `

Indicates whether some other object is "equal to" this one.
` abstract float[]` ` https://developer.android.com/reference/android/graphics/ColorSpace#fromXyz(float[])(float[] v) `

<br />

Converts tristimulus values from the CIE XYZ space to this color space's color model.
` float[]` ` https://developer.android.com/reference/android/graphics/ColorSpace#fromXyz(float,%20float,%20float)(float x, float y, float z) `

<br />

Converts tristimulus values from the CIE XYZ space to this color space's color model.
` static https://developer.android.com/reference/android/graphics/ColorSpace` ` https://developer.android.com/reference/android/graphics/ColorSpace#get(android.graphics.ColorSpace.Named)(https://developer.android.com/reference/android/graphics/ColorSpace.Named name) `

<br />

Returns an instance of `https://developer.android.com/reference/android/graphics/ColorSpace` identified by the specified name.
` int` ` https://developer.android.com/reference/android/graphics/ColorSpace#getComponentCount()() `

Returns the number of components that form a color value according to this color space's color model.
` int` ` https://developer.android.com/reference/android/graphics/ColorSpace#getDataSpace()() `

Retrieve the `https://developer.android.com/reference/android/hardware/DataSpace` value from a `https://developer.android.com/reference/android/graphics/ColorSpace` object.
` static https://developer.android.com/reference/android/graphics/ColorSpace` ` https://developer.android.com/reference/android/graphics/ColorSpace#getFromDataSpace(int)(int dataSpace) `

Create a `https://developer.android.com/reference/android/graphics/ColorSpace` object using a `https://developer.android.com/reference/android/hardware/DataSpace` value.
` int` ` https://developer.android.com/reference/android/graphics/ColorSpace#getId()() `

Returns the ID of this color space.
` abstract float` ` https://developer.android.com/reference/android/graphics/ColorSpace#getMaxValue(int)(int component) `

Returns the maximum valid value for the specified component of this color space's color model.
` abstract float` ` https://developer.android.com/reference/android/graphics/ColorSpace#getMinValue(int)(int component) `

Returns the minimum valid value for the specified component of this color space's color model.
` https://developer.android.com/reference/android/graphics/ColorSpace.Model` ` https://developer.android.com/reference/android/graphics/ColorSpace#getModel()() `

Return the color model of this color space.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/android/graphics/ColorSpace#getName()() `

<br />

Returns the name of this color space.
` int` ` https://developer.android.com/reference/android/graphics/ColorSpace#hashCode()() `

Returns a hash code value for the object.
` boolean` ` https://developer.android.com/reference/android/graphics/ColorSpace#isSrgb()() `

<br />

Indicates whether this color space is the sRGB color space or equivalent to the sRGB color space.
` abstract boolean` ` https://developer.android.com/reference/android/graphics/ColorSpace#isWideGamut()() `

Returns whether this color space is a wide-gamut color space.
` static https://developer.android.com/reference/android/graphics/ColorSpace` ` https://developer.android.com/reference/android/graphics/ColorSpace#match(float[],%20android.graphics.ColorSpace.Rgb.TransferParameters)(float[] toXYZD50, https://developer.android.com/reference/android/graphics/ColorSpace.Rgb.TransferParameters function) `

<br />

Returns a `https://developer.android.com/reference/android/graphics/ColorSpace.Named` instance of `https://developer.android.com/reference/android/graphics/ColorSpace` that matches the specified RGB to CIE XYZ transform and transfer functions.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/android/graphics/ColorSpace#toString()() `

<br />

Returns a string representation of the object.
` float[]` ` https://developer.android.com/reference/android/graphics/ColorSpace#toXyz(float,%20float,%20float)(float r, float g, float b) `

<br />

Converts a color value from this color space's model to tristimulus CIE XYZ values.
` abstract float[]` ` https://developer.android.com/reference/android/graphics/ColorSpace#toXyz(float[])(float[] v) `

<br />

Converts a color value from this color space's model to tristimulus CIE XYZ values.
From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public constructors

### Rgb

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

```
public Rgb (String name, 
                float[] toXYZ, 
                ColorSpace.Rgb.TransferParameters function)
```

<br />

Creates a new RGB color space using a 3x3 column-major transform matrix. The transform matrix must convert from the RGB space to the profile connection space CIE XYZ.

The range of the color space is imposed to be \\(\[0..1\]\\).

<br />

<br />

| Parameters ||
|---|---|
| `name` | `String`: Name of the color space, cannot be null, its length must be \>= 1 <br /> |
| `toXYZ` | `float`: 3x3 column-major transform matrix from RGB to the profile connection space CIE XYZ as an array of 9 floats, cannot be null <br /> |
| `function` | `ColorSpace.Rgb.TransferParameters`: Parameters for the transfer functions. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | If any of the following conditions is met: - The name is null or has a length of 0. - Gamma is negative. |

**See also:**

- `https://developer.android.com/reference/android/graphics/ColorSpace#get(android.graphics.ColorSpace.Named)`

### Rgb

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

```
public Rgb (String name, 
                float[] toXYZ, 
                double gamma)
```

<br />

Creates a new RGB color space using a 3x3 column-major transform matrix. The transform matrix must convert from the RGB space to the profile connection space CIE XYZ.

The range of the color space is imposed to be \\(\[0..1\]\\).

<br />

<br />

| Parameters ||
|---|---|
| `name` | `String`: Name of the color space, cannot be null, its length must be \>= 1 <br /> |
| `toXYZ` | `float`: 3x3 column-major transform matrix from RGB to the profile connection space CIE XYZ as an array of 9 floats, cannot be null <br /> |
| `gamma` | `double`: Gamma to use as the transfer function <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | If any of the following conditions is met: - The name is null or has a length of 0. - Gamma is negative. |

**See also:**

- `https://developer.android.com/reference/android/graphics/ColorSpace#get(android.graphics.ColorSpace.Named)`

### Rgb

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

```
public Rgb (String name, 
                float[] primaries, 
                float[] whitePoint, 
                ColorSpace.Rgb.TransferParameters function)
```

<br />

Creates a new RGB color space using a specified set of primaries and a specified white point.

The primaries and white point can be specified in the CIE xyY space or in CIE XYZ. The length of the arrays depends on the chosen space:

| Space | Primaries length | White point length |
|---|---|---|
| xyY | 6 | 2 |
| XYZ | 9 | 3 |

When the primaries and/or white point are specified in xyY, the Y component does not need to be specified and is assumed to be 1.0. Only the xy components are required.

<br />

<br />

| Parameters ||
|---|---|
| `name` | `String`: Name of the color space, cannot be null, its length must be \>= 1 <br /> |
| `primaries` | `float`: RGB primaries as an array of 6 (xy) or 9 (XYZ) floats. This value cannot be `null`. <br /> |
| `whitePoint` | `float`: Reference white as an array of 2 (xy) or 3 (XYZ) floats. This value cannot be `null`. <br /> |
| `function` | `ColorSpace.Rgb.TransferParameters`: Parameters for the transfer functions. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | If any of the following conditions is met: - The name is null or has a length of 0. - The primaries array is null or has a length that is neither 6 or 9. - The white point array is null or has a length that is neither 2 or 3. - The transfer parameters are invalid. |

**See also:**

- `https://developer.android.com/reference/android/graphics/ColorSpace#get(android.graphics.ColorSpace.Named)`

### Rgb

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

```
public Rgb (String name, 
                float[] primaries, 
                float[] whitePoint, 
                double gamma)
```

<br />

Creates a new RGB color space using a specified set of primaries and a specified white point.

The primaries and white point can be specified in the CIE xyY space or in CIE XYZ. The length of the arrays depends on the chosen space:

| Space | Primaries length | White point length |
|---|---|---|
| xyY | 6 | 2 |
| XYZ | 9 | 3 |

When the primaries and/or white point are specified in xyY, the Y component does not need to be specified and is assumed to be 1.0. Only the xy components are required.

<br />

<br />

| Parameters ||
|---|---|
| `name` | `String`: Name of the color space, cannot be null, its length must be \>= 1 <br /> |
| `primaries` | `float`: RGB primaries as an array of 6 (xy) or 9 (XYZ) floats. This value cannot be `null`. <br /> |
| `whitePoint` | `float`: Reference white as an array of 2 (xy) or 3 (XYZ) floats. This value cannot be `null`. <br /> |
| `gamma` | `double`: Gamma to use as the transfer function <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | If any of the following conditions is met: - The name is null or has a length of 0. - The primaries array is null or has a length that is neither 6 or 9. - The white point array is null or has a length that is neither 2 or 3. - Gamma is negative. |

**See also:**

- `https://developer.android.com/reference/android/graphics/ColorSpace#get(android.graphics.ColorSpace.Named)`

### Rgb

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

```
public Rgb (String name, 
                float[] primaries, 
                float[] whitePoint, 
                DoubleUnaryOperator oetf, 
                DoubleUnaryOperator eotf, 
                float min, 
                float max)
```

<br />

Creates a new RGB color space using a specified set of primaries and a specified white point.

The primaries and white point can be specified in the CIE xyY space or in CIE XYZ. The length of the arrays depends on the chosen space:

| Space | Primaries length | White point length |
|---|---|---|
| xyY | 6 | 2 |
| XYZ | 9 | 3 |

When the primaries and/or white point are specified in xyY, the Y component does not need to be specified and is assumed to be 1.0. Only the xy components are required.

The ID, as returned by `https://developer.android.com/reference/android/graphics/ColorSpace#getId()`, of an object created by this constructor is always `https://developer.android.com/reference/android/graphics/ColorSpace#MIN_ID`.

<br />

<br />

| Parameters ||
|---|---|
| `name` | `String`: Name of the color space, cannot be null, its length must be \>= 1 <br /> |
| `primaries` | `float`: RGB primaries as an array of 6 (xy) or 9 (XYZ) floats. This value cannot be `null`. <br /> |
| `whitePoint` | `float`: Reference white as an array of 2 (xy) or 3 (XYZ) floats. This value cannot be `null`. <br /> |
| `oetf` | `DoubleUnaryOperator`: Opto-electronic transfer function, cannot be null <br /> |
| `eotf` | `DoubleUnaryOperator`: Electro-optical transfer function, cannot be null <br /> |
| `min` | `float`: The minimum valid value in this color space's RGB range <br /> |
| `max` | `float`: The maximum valid value in this color space's RGB range <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | If any of the following conditions is met: - The name is null or has a length of 0. - The primaries array is null or has a length that is neither 6 or 9. - The white point array is null or has a length that is neither 2 or 3. - The OETF is null or the EOTF is null. - The minimum valid value is \>= the maximum valid value. |

**See also:**

- `https://developer.android.com/reference/android/graphics/ColorSpace#get(android.graphics.ColorSpace.Named)`

### Rgb

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

```
public Rgb (String name, 
                float[] toXYZ, 
                DoubleUnaryOperator oetf, 
                DoubleUnaryOperator eotf)
```

<br />

Creates a new RGB color space using a 3x3 column-major transform matrix. The transform matrix must convert from the RGB space to the profile connection space CIE XYZ.

The range of the color space is imposed to be \\(\[0..1\]\\).

<br />

<br />

| Parameters ||
|---|---|
| `name` | `String`: Name of the color space, cannot be null, its length must be \>= 1 <br /> |
| `toXYZ` | `float`: 3x3 column-major transform matrix from RGB to the profile connection space CIE XYZ as an array of 9 floats, cannot be null <br /> |
| `oetf` | `DoubleUnaryOperator`: Opto-electronic transfer function, cannot be null <br /> |
| `eotf` | `DoubleUnaryOperator`: Electro-optical transfer function, cannot be null <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | If any of the following conditions is met: - The name is null or has a length of 0. - The OETF is null or the EOTF is null. - The minimum valid value is \>= the maximum valid value. |

**See also:**

- `https://developer.android.com/reference/android/graphics/ColorSpace#get(android.graphics.ColorSpace.Named)`

## Public methods

### equals

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

```
public boolean equals (Object o)
```

Indicates whether some other object is "equal to" this one.

The `equals` method implements an equivalence relation on non-null object references:

- It is *reflexive*: for any non-null reference value `x`, `x.equals(x)` should return `true`.
- It is *symmetric*: for any non-null reference values `x` and `y`, `x.equals(y)` should return `true` if and only if `y.equals(x)` returns `true`.
- It is *transitive*: for any non-null reference values `x`, `y`, and `z`, if `x.equals(y)` returns `true` and `y.equals(z)` returns `true`, then `x.equals(z)` should return `true`.
- It is *consistent*: for any non-null reference values `x` and `y`, multiple invocations of `x.equals(y)` consistently return `true` or consistently return `false`, provided no information used in `equals` comparisons on the objects is modified.
- For any non-null reference value `x`, `x.equals(null)` should return `false`.

An equivalence relation partitions the elements it operates on into *equivalence classes*; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

<br />

| Parameters ||
|---|---|
| `o` | `Object`: the reference object with which to compare. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if this object is the same as the obj argument; `false` otherwise. <br /> |

### fromLinear

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

```
public float[] fromLinear (float[] v)
```

<br />

Encodes an RGB value from linear space to this color space's "gamma space". This is achieved by applying this color space's opto-electronic transfer function to the first 3 values of the supplied array. The result is stored back in the input array.

Refer to the documentation of `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb` for more information about transfer functions and their use for encoding and decoding RGB values.

<br />

<br />

| Parameters ||
|---|---|
| `v` | `float`: A non-null array of linear RGB values, its length must be at least 3 <br /> |

| Returns ||
|---|---|
| `float[]` | A new array of 3 floats containing non-linear RGB values. This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#fromLinear(float[])`
- `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#toLinear(float,%20float,%20float)`

### fromLinear

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

```
public float[] fromLinear (float r, 
                float g, 
                float b)
```

<br />

Encodes an RGB value from linear space to this color space's "gamma space". This is achieved by applying this color space's opto-electronic transfer function to the supplied values.

Refer to the documentation of `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb` for more information about transfer functions and their use for encoding and decoding RGB values.

<br />

<br />

| Parameters ||
|---|---|
| `r` | `float`: The red component to encode from linear space <br /> |
| `g` | `float`: The green component to encode from linear space <br /> |
| `b` | `float`: The blue component to encode from linear space <br /> |

| Returns ||
|---|---|
| `float[]` | A new array of 3 floats containing non-linear RGB values. This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#fromLinear(float[])`
- `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#toLinear(float,%20float,%20float)`

### fromXyz

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

```
public float[] fromXyz (float[] v)
```

<br />

Converts tristimulus values from the CIE XYZ space to this color space's color model. The resulting value is passed back in the specified array.

The specified array's length must be at least equal to to the number of color components as returned by `https://developer.android.com/reference/android/graphics/ColorSpace.Model#getComponentCount()`, and its first 3 values must be the XYZ components to convert from.

<br />

<br />

| Parameters ||
|---|---|
| `v` | `float`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `float[]` | This value cannot be `null`. <br /> |

### getEotf

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

```
public DoubleUnaryOperator getEotf ()
```

<br />

Returns the electro-optical transfer function (EOTF) of this color space. The inverse function is the opto-electronic transfer function (OETF) returned by `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getOetf()`. These functions are defined to satisfy the following equality for \\(x \\in \[0..1\]\\):
$$OETF(EOTF(x)) = EOTF(OETF(x)) = x$$

For RGB colors, this function can be used to convert from "gamma space" (gamma encoded) to linear space. The terms gamma space and gamma encoded are frequently used because many EOTFs can be closely approximated using a simple power function of the form \\(x\^\\gamma\\) (the approximation of the `https://developer.android.com/reference/android/graphics/ColorSpace.Named#SRGB` EOTF uses \\(\\gamma=2.2\\) for instance).

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/function/DoubleUnaryOperator` | A transfer function that converts from "gamma space" to linear space. This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getOetf()`
- `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getTransferParameters()`

### getInverseTransform

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

```
public float[] getInverseTransform (float[] inverseTransform)
```

<br />

Copies the inverse transform of this color space in specified array. The inverse transform is used to convert from XYZ to RGB (with the same white point as this color space). To connect color spaces, you must first `https://developer.android.com/reference/android/graphics/ColorSpace#adapt(android.graphics.ColorSpace,%20float[])` them to the same white point.

It is recommended to use `https://developer.android.com/reference/android/graphics/ColorSpace#connect(android.graphics.ColorSpace,%20android.graphics.ColorSpace)` to convert between color spaces.

<br />

<br />

| Parameters ||
|---|---|
| `inverseTransform` | `float`: The destination array, cannot be null, its length must be \>= 9 <br /> |

| Returns ||
|---|---|
| `float[]` | The destination array passed as a parameter. This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getInverseTransform()`

### getInverseTransform

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

```
public float[] getInverseTransform ()
```

<br />

Returns the inverse transform of this color space as a new array. The inverse transform is used to convert from XYZ to RGB (with the same white point as this color space). To connect color spaces, you must first `https://developer.android.com/reference/android/graphics/ColorSpace#adapt(android.graphics.ColorSpace,%20float[])` them to the same white point.

It is recommended to use `https://developer.android.com/reference/android/graphics/ColorSpace#connect(android.graphics.ColorSpace,%20android.graphics.ColorSpace)` to convert between color spaces.

<br />

<br />

| Returns ||
|---|---|
| `float[]` | A new array of 9 floats. This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getInverseTransform(float[])`

### getMaxValue

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

```
public float getMaxValue (int component)
```

Returns the maximum valid value for the specified component of this color space's color model.

<br />

| Parameters ||
|---|---|
| `component` | `int`: The index of the component. Value is between 0 and 3 inclusive <br /> |

| Returns ||
|---|---|
| `float` | A floating point value greater than `https://developer.android.com/reference/android/graphics/ColorSpace#getMinValue(int)` <br /> |

### getMinValue

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

```
public float getMinValue (int component)
```

Returns the minimum valid value for the specified component of this color space's color model.

<br />

| Parameters ||
|---|---|
| `component` | `int`: The index of the component. Value is between 0 and 3 inclusive <br /> |

| Returns ||
|---|---|
| `float` | A floating point value less than `https://developer.android.com/reference/android/graphics/ColorSpace#getMaxValue(int)` <br /> |

### getOetf

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

```
public DoubleUnaryOperator getOetf ()
```

<br />

Returns the opto-electronic transfer function (OETF) of this color space. The inverse function is the electro-optical transfer function (EOTF) returned by `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getEotf()`. These functions are defined to satisfy the following equality for \\(x \\in \[0..1\]\\):
$$OETF(EOTF(x)) = EOTF(OETF(x)) = x$$

For RGB colors, this function can be used to convert from linear space to "gamma space" (gamma encoded). The terms gamma space and gamma encoded are frequently used because many OETFs can be closely approximated using a simple power function of the form \\(x\^{\\frac{1}{\\gamma}}\\) (the approximation of the `https://developer.android.com/reference/android/graphics/ColorSpace.Named#SRGB` OETF uses \\(\\gamma=2.2\\) for instance).

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/function/DoubleUnaryOperator` | A transfer function that converts from linear space to "gamma space". This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getEotf()`
- `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getTransferParameters()`

### getPrimaries

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

```
public float[] getPrimaries (float[] primaries)
```

Copies the primaries of this color space in specified array. The Y component is assumed to be 1 and is therefore not copied into the destination. The x and y components of the first primary are written in the array at positions 0 and 1 respectively.

Note: Some ColorSpaces represent gray profiles. The concept of primaries for such a ColorSpace does not make sense, so we use a special set of primaries that are all 1s.

<br />

<br />

| Parameters ||
|---|---|
| `primaries` | `float`: The destination array, cannot be null, its length must be \>= 6 <br /> |

| Returns ||
|---|---|
| `float[]` | The destination array passed as a parameter. This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getPrimaries()`

### getPrimaries

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

```
public float[] getPrimaries ()
```

Returns the primaries of this color space as a new array of 6 floats. The Y component is assumed to be 1 and is therefore not copied into the destination. The x and y components of the first primary are written in the array at positions 0 and 1 respectively.

Note: Some ColorSpaces represent gray profiles. The concept of primaries for such a ColorSpace does not make sense, so we use a special set of primaries that are all 1s.

<br />

<br />

| Returns ||
|---|---|
| `float[]` | A new non-null array of 6 floats <br /> |

**See also:**

- `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getPrimaries(float[])`

### getTransferParameters

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

```
public ColorSpace.Rgb.TransferParameters getTransferParameters ()
```

<br />

Returns the parameters used by the `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getEotf()` and `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getOetf()` transfer functions. If the transfer functions do not match the ICC parametric curves defined in ICC.1:2004-10 (section 10.15), this method returns null.

See `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb.TransferParameters` for a full description of the transfer functions.

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb.TransferParameters` | An instance of `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb.TransferParameters` or null if this color space's transfer functions do not match the equation defined in `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb.TransferParameters` <br /> |

### getTransform

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

```
public float[] getTransform ()
```

<br />

Returns the transform of this color space as a new array. The transform is used to convert from RGB to XYZ (with the same white point as this color space). To connect color spaces, you must first `https://developer.android.com/reference/android/graphics/ColorSpace#adapt(android.graphics.ColorSpace,%20float[])` them to the same white point.

It is recommended to use `https://developer.android.com/reference/android/graphics/ColorSpace#connect(android.graphics.ColorSpace,%20android.graphics.ColorSpace)` to convert between color spaces.

<br />

<br />

| Returns ||
|---|---|
| `float[]` | A new array of 9 floats. This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getTransform(float[])`

### getTransform

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

```
public float[] getTransform (float[] transform)
```

<br />

Copies the transform of this color space in specified array. The transform is used to convert from RGB to XYZ (with the same white point as this color space). To connect color spaces, you must first `https://developer.android.com/reference/android/graphics/ColorSpace#adapt(android.graphics.ColorSpace,%20float[])` them to the same white point.

It is recommended to use `https://developer.android.com/reference/android/graphics/ColorSpace#connect(android.graphics.ColorSpace,%20android.graphics.ColorSpace)` to convert between color spaces.

<br />

<br />

| Parameters ||
|---|---|
| `transform` | `float`: The destination array, cannot be null, its length must be \>= 9 <br /> |

| Returns ||
|---|---|
| `float[]` | The destination array passed as a parameter. This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getTransform()`

### getWhitePoint

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

```
public float[] getWhitePoint ()
```

Returns the non-adapted CIE xyY white point of this color space as a new array of 2 floats. The Y component is assumed to be 1 and is therefore not copied into the destination. The x and y components are written in the array at positions 0 and 1 respectively.

<br />

| Returns ||
|---|---|
| `float[]` | A new non-null array of 2 floats <br /> |

**See also:**

- `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getWhitePoint(float[])`

### getWhitePoint

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

```
public float[] getWhitePoint (float[] whitePoint)
```

Copies the non-adapted CIE xyY white point of this color space in specified array. The Y component is assumed to be 1 and is therefore not copied into the destination. The x and y components are written in the array at positions 0 and 1 respectively.

<br />

| Parameters ||
|---|---|
| `whitePoint` | `float`: The destination array, cannot be null, its length must be \>= 2 <br /> |

| Returns ||
|---|---|
| `float[]` | The destination array passed as a parameter. This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#getWhitePoint()`

### hashCode

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

```
public int hashCode ()
```

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by `https://developer.android.com/reference/java/util/HashMap`.

The general contract of `hashCode` is:

- Whenever it is invoked on the same object more than once during an execution of a Java application, the `hashCode` method must consistently return the same integer, provided no information used in `equals` comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
- If two objects are equal according to the `https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)` method, then calling the `hashCode` method on each of the two objects must produce the same integer result.
- It is *not* required that if two objects are unequal according to the `https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)` method, then calling the `hashCode` method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.

<br />

<br />

| Returns ||
|---|---|
| `int` | a hash code value for this object. <br /> |

### isSrgb

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

```
public boolean isSrgb ()
```

<br />

Indicates whether this color space is the sRGB color space or equivalent to the sRGB color space.

A color space is considered sRGB if it meets all the following conditions:

- Its color model is `https://developer.android.com/reference/android/graphics/ColorSpace.Model#RGB`.
- Its primaries are within 1e-3 of the true `https://developer.android.com/reference/android/graphics/ColorSpace.Named#SRGB` primaries.
- Its white point is within 1e-3 of the CIE standard illuminant `https://developer.android.com/reference/android/graphics/ColorSpace#ILLUMINANT_D65`.
- Its opto-electronic transfer function is not linear.
- Its electro-optical transfer function is not linear.
- Its transfer functions yield values within 1e-3 of `https://developer.android.com/reference/android/graphics/ColorSpace.Named#SRGB`.
- Its range is \\(\[0..1\]\\).

This method always returns true for `https://developer.android.com/reference/android/graphics/ColorSpace.Named#SRGB`.

<br />

<br />

| Returns ||
|---|---|
| `boolean` | True if this color space is the sRGB color space (or a close approximation), false otherwise <br /> |

### isWideGamut

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

```
public boolean isWideGamut ()
```

Returns whether this color space is a wide-gamut color space. An RGB color space is wide-gamut if its gamut entirely contains the `https://developer.android.com/reference/android/graphics/ColorSpace.Named#SRGB` gamut and if the area of its gamut is 90% of greater than the area of the `https://developer.android.com/reference/android/graphics/ColorSpace.Named#NTSC_1953` gamut.

<br />

| Returns ||
|---|---|
| `boolean` | True if this color space is a wide-gamut color space, false otherwise <br /> |

### toLinear

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

```
public float[] toLinear (float[] v)
```

<br />

Decodes an RGB value to linear space. This is achieved by applying this color space's electro-optical transfer function to the first 3 values of the supplied array. The result is stored back in the input array.

Refer to the documentation of `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb` for more information about transfer functions and their use for encoding and decoding RGB values.

<br />

<br />

| Parameters ||
|---|---|
| `v` | `float`: A non-null array of non-linear RGB values, its length must be at least 3 <br /> |

| Returns ||
|---|---|
| `float[]` | The specified array. This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#toLinear(float,%20float,%20float)`
- `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#fromLinear(float[])`

### toLinear

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

```
public float[] toLinear (float r, 
                float g, 
                float b)
```

<br />

Decodes an RGB value to linear space. This is achieved by applying this color space's electro-optical transfer function to the supplied values.

Refer to the documentation of `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb` for more information about transfer functions and their use for encoding and decoding RGB values.

<br />

<br />

| Parameters ||
|---|---|
| `r` | `float`: The red component to decode to linear space <br /> |
| `g` | `float`: The green component to decode to linear space <br /> |
| `b` | `float`: The blue component to decode to linear space <br /> |

| Returns ||
|---|---|
| `float[]` | A new array of 3 floats containing linear RGB values. This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#toLinear(float[])`
- `https://developer.android.com/reference/android/graphics/ColorSpace.Rgb#fromLinear(float,%20float,%20float)`

### toXyz

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

```
public float[] toXyz (float[] v)
```

<br />

Converts a color value from this color space's model to tristimulus CIE XYZ values. If the color model of this color space is not `https://developer.android.com/reference/android/graphics/ColorSpace.Model#RGB`, it is assumed that the target CIE XYZ space uses a `https://developer.android.com/reference/android/graphics/ColorSpace#ILLUMINANT_D50` standard illuminant.

The specified array's length must be at least equal to to the number of color components as returned by `https://developer.android.com/reference/android/graphics/ColorSpace.Model#getComponentCount()`.

<br />

<br />

| Parameters ||
|---|---|
| `v` | `float`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `float[]` | This value cannot be `null`. <br /> |