Function

adapt

Performs the chromatic adaptation of a color space from its native white point to the specified white point.

adapt

Source set: Common
public fun ColorSpace.adapt(
    whitePoint: WhitePoint,
    adaptation: Adaptation = Adaptation.Bradford,
): ColorSpace

Performs the chromatic adaptation of a color space from its native white point to the specified white point. If the specified color space does not have an RGB color model, or if the color space already has the target white point, the color space is returned unmodified.

The chromatic adaptation is performed using the von Kries method described in the documentation of Adaptation.

Parameters

whitePoint The new white point
adaptation The adaptation matrix

Return

A new color space if the specified color space has an RGB model and a white point different from the specified white point; the specified color space otherwise

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: