A ColorSpace is used to identify a specific organization of colors.
A connector transforms colors from a source color space to a destination color space.
An RGB color space is an additive color space using the RGB color model (a color is therefore represented by a tuple of 3 numbers).
Defines the parameters for the ICC parametric curve type 4, as defined in ICC.
Class for constructing white points used in RGB color space.
List of adaptation matrices that can be used for chromatic adaptation using the von Kries transform.
A color model is required by a ColorSpace to describe the way colors can be represented as tuples of numbers.
A render intent determines how a connector maps colors from one color space to another.
Extension functions summary
Performs the chromatic adaptation of a color space from its native white point to the specified white point.
Connects two color spaces to allow conversion from the source color space to the destination color space.
@JvmOverloads fun ColorSpace.adapt(
adaptation: Adaptation = Adaptation.Bradford
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.
|whitePoint: WhitePoint||The new white point|
|adaptation: Adaptation = Adaptation.Bradford||The adaptation matrix|
|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|
destination: ColorSpace = ColorSpaces.Srgb,
intent: RenderIntent = RenderIntent.Perceptual
Connects two color spaces to allow conversion from the source color space to the destination color space. If the source and destination color spaces do not have the same profile connection space (CIE XYZ with the same white point), they are chromatically adapted to use the CIE standard illuminant D50 as needed.
If the source and destination are the same, an optimized connector is returned to avoid unnecessary computations and loss of precision.
|destination: ColorSpace = ColorSpaces.Srgb||The color space to convert colors to|
|intent: RenderIntent = RenderIntent.Perceptual||The render intent to map colors from the source to the destination|
|A non-null connector between the two specified color spaces|