Color Conversions

Color spaces

Explain some color spaces here.

Color Conversion Methods

ColorToRGB

procedure ColorToRGB(Color: integer; var r, g, b: Integer);

RGBtoColor

function RGBtoColor(r, g, b: Integer): TColor;

ColorToHSL

procedure ColorToHSL(Color: Integer; var h, s, l: Extended);

HSLToColor

function HSLToColor(H, S, L: Extended): TColor;

ColorToXYZ

procedure ColorToXYZ(Color: Integer; var x, y, z: Extended);

XYZToColor

function XYZToColor(X, Y, Z: Extended): TColor;

RGBToHSL

procedure RGBToHSL(R, G, B: Integer; var h, s, l: Extended);

HSLtoRGB

procedure HSLtoRGB(H, S, L: extended; var R, G ,B: Integer);

RGBToXYZ

procedure RGBToXYZ(R, G, B: Integer;var x, y ,z: Extended);

XYZToRGB

procedure XYZToRGB(X, Y, Z: Extended; var R, G, B: Integer);

CIELabToColor

function CIELabToColor(L, a, b: Extended): TColor

CIELabToHSL

procedure CIELabToHSL(L, a, b: Extended; out HH, SS, LL: Extended)

CIELabToRGB

procedure CIELabToRGB(L, a, b: Extended; out rr, gg, bb: Integer)

CIELabtoXYZ

procedure CIELabtoXYZ(L, a, b: Extended; out X, Y, Z: Extended)

ColorToCIELab

procedure ColorToCIELab(Color: Integer; out L, a, b: Extended)

ColorToGray

function ColorToGray(const Color: Integer): TColor

HSLToCIELab

procedure HSLToCIELab(HH, SS, LL: Extended; out L, a, b: Extended)

HSLToXYZ

procedure HSLToXYZ(H, S, L: Extended; out X, Y, Z: Extended)

RGBToCIELab

procedure RGBToCIELab(rr, gg, bb: Integer; out L, a, b: Extended)

XYZtoCIELab

procedure XYZtoCIELab(X, Y, Z: Extended; out L, a, b: Extended)

XYZToHSL

procedure XYZToHSL(X, Y, Z: Extended; out H, S, L: Extended)