adapt

Function

Common
@kotlin.jvm.JvmOverloads
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

whitePointThe new white point
adaptationThe adaptation matrix

Returns

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