The OpenD Programming Language

convertColor

Convert between color types.

Conversion is always supported between any pair of valid color types. Colour types usually implement only direct conversion between their immediate 'parent' color type. In the case of distantly related colors, convertColor will follow a conversion path via intermediate representations such that it is able to perform the conversion.

For instance, a conversion from HSV to Lab necessary follows the conversion path: HSV -> RGB -> XYZ -> Lab.

@safe pure nothrow @nogc
To
convertColor
(
To
From
)
(
From color
)

Return Value

Type: To

color converted to the target format.

Examples

assert(convertColor!(RGBA8)(convertColor!(XYZ!float)(RGBA8(0xFF, 0xFF, 0xFF, 0xFF))) == RGBA8(0xFF, 0xFF, 0xFF, 0));

Meta