{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

ColorSpaces

public static class ColorSpaces


Summary

Public fields

static @NonNull ColorSpaces

Public methods

final @NonNull Rgb

RGB color space ACES standardized as SMPTE ST 2065-1:2012.

final @NonNull Rgb

RGB color space ACEScg standardized as Academy S-2014-004.

final @NonNull Rgb

RGB color space Adobe RGB (1998).

final @NonNull Rgb

RGB color space BT.2020 standardized as Rec.

final @NonNull Rgb

RGB color space BT.709 standardized as Rec.

final @NonNull ColorSpace

Lab color space CIE Lab*.

final @NonNull ColorSpace

XYZ color space CIE XYZ.

final @NonNull Rgb

RGB color space DCI-P3 standardized as SMPTE RP 431-2-2007.

final @NonNull Rgb

RGB color space Display P3 based on SMPTE RP 431-2-2007 and IEC 61966-2.1:1999.

final @NonNull Rgb

RGB color space scRGB-nl standardized as IEC 61966-2-2:2003.

final @NonNull Rgb

RGB color space scRGB standardized as IEC 61966-2-2:2003.

final @NonNull Rgb

RGB color space sRGB standardized as IEC 61966-2.1:1999.

final @NonNull Rgb

RGB color space NTSC, 1953 standard.

final @NonNull ColorSpace

Lab color space Oklab.

final @NonNull Rgb

RGB color space ProPhoto RGB standardized as ROMM RGB ISO 22028-2:2013.

final @NonNull Rgb

RGB color space SMPTE C.

final @NonNull Rgb

RGB color space sRGB standardized as IEC 61966-2.1:1999.

final ColorSpace
match(@NonNull float[] toXYZD50, @NonNull TransferParameters function)

Returns a ColorSpaces instance of ColorSpace that matches the specified RGB to CIE XYZ transform and transfer functions.

Public fields

INSTANCE

public static @NonNull ColorSpaces INSTANCE

Public methods

getAces

public final @NonNull Rgb getAces()

RGB color space ACES standardized as SMPTE ST 2065-1:2012. See details on ACES color space

getAcescg

public final @NonNull Rgb getAcescg()

RGB color space ACEScg standardized as Academy S-2014-004. See details on ACEScg color space

getAdobeRgb

public final @NonNull Rgb getAdobeRgb()

RGB color space Adobe RGB (1998). See details on Adobe RGB (1998) color space

getBt2020

public final @NonNull Rgb getBt2020()

RGB color space BT.2020 standardized as Rec. ITU-R BT.2020-1. See details on BT.2020 color space

getBt709

public final @NonNull Rgb getBt709()

RGB color space BT.709 standardized as Rec. ITU-R BT.709-5. See details on BT.709 color space

getCieLab

public final @NonNull ColorSpace getCieLab()

Lab color space CIE Lab*. This color space uses CIE XYZ D50 as a profile conversion space.

| Property                | Value                                                   |
|-------------------------|---------------------------------------------------------|
| Name | Generic L*a*b* |
| CIE standard illuminant | [D50][Illuminant.D50] |
| Range | (L: `[0.0, 100.0]`, a: `[-128, 128]`, b: `[-128, 128]`) |

getCieXyz

public final @NonNull ColorSpace getCieXyz()

XYZ color space CIE XYZ. This color space assumes standard illuminant D50 as its white point.

| Property                | Value                 |
|-------------------------|-----------------------|
| Name | Generic XYZ |
| CIE standard illuminant | [D50][Illuminant.D50] |
| Range | `[-2.0, 2.0]` |

getDciP3

public final @NonNull Rgb getDciP3()

RGB color space DCI-P3 standardized as SMPTE RP 431-2-2007. See details on DCI-P3 color space

getDisplayP3

public final @NonNull Rgb getDisplayP3()

RGB color space Display P3 based on SMPTE RP 431-2-2007 and IEC 61966-2.1:1999. See details on Display P3 color space

getExtendedSrgb

public final @NonNull Rgb getExtendedSrgb()

RGB color space scRGB-nl standardized as IEC 61966-2-2:2003. See details on Extended sRGB color space

getLinearExtendedSrgb

public final @NonNull Rgb getLinearExtendedSrgb()

RGB color space scRGB standardized as IEC 61966-2-2:2003. See details on Linear Extended sRGB color space

getLinearSrgb

public final @NonNull Rgb getLinearSrgb()

RGB color space sRGB standardized as IEC 61966-2.1:1999. See details on Linear sRGB color space

getNtsc1953

public final @NonNull Rgb getNtsc1953()

RGB color space NTSC, 1953 standard. See details on NTSC 1953 color space

getOklab

public final @NonNull ColorSpace getOklab()

Lab color space Oklab. This color space uses Oklab D65 as a profile conversion space.

| Property                | Value                                                   |
|-------------------------|---------------------------------------------------------|
| Name | Oklab |
| CIE standard illuminant | [D65][Illuminant.D65] |
| Range | (L: `[0.0, 1.0]`, a: `[-2, 2]`, b: `[-2, 2]`) |

getProPhotoRgb

public final @NonNull Rgb getProPhotoRgb()

RGB color space ProPhoto RGB standardized as ROMM RGB ISO 22028-2:2013. See details on ProPhoto RGB color space

getSmpteC

public final @NonNull Rgb getSmpteC()

RGB color space SMPTE C. See details on SMPTE C color space

getSrgb

public final @NonNull Rgb getSrgb()

RGB color space sRGB standardized as IEC 61966-2.1:1999. See details on sRGB color space

match

public final ColorSpace match(@NonNull float[] toXYZD50, @NonNull TransferParameters function)

Returns a ColorSpaces instance of ColorSpace that matches the specified RGB to CIE XYZ transform and transfer functions. If no instance can be found, this method returns null.

The color transform matrix is assumed to target the CIE XYZ space a D50 standard illuminant.

Parameters
@NonNull float[] toXYZD50

3x3 column-major transform matrix from RGB to the profile connection space CIE XYZ as an array of 9 floats, cannot be null

@NonNull TransferParameters function

Parameters for the transfer functions

Returns
ColorSpace

A non-null ColorSpace if a match is found, null otherwise