2.1.6.36 RGBtoLAB


Description

convert RGB color to LAB

Syntax

void RGBtoLAB( COLORREF cr, double* L, double* a, double* b )

Parameters

cr
[input] rgb values to convert
L
[output] pointer to receive Lightness
a
[output] pointer to receive a
b
[output] pointer to receive b

Return

Examples

EX1

void RGB_LAB_convert(int rr=255, int gg=125, int bb=50)
{
	int rgb = RGB(rr, gg, bb);
	double l, a, b;
	RGBtoLAB(rgb,&l, &a, &b);
	//printf("result: %g, %g, %g\n", l, a, b);
	DWORD dw = LABtoRGB(l, a, b);
	printf("%d %d %d\n", GetRValue(dw), GetGValue(dw), GetBValue(dw));
}

Remark

See Also

LABtoRGB

Header to Included

origin.h

Reference