HSLtoRGB

 

Description

convert HSL color to RGB

Syntax

DWORD HSLtoRGB( double hue, double sat, double lum )

Parameters

hue
[input] Hue between 0 and 1
sat
[input] Saturation between 0 and 1
lum
[input] Lightness between 0 and 1

Return

RGB value

Examples

EX1

void hsl2rgb_ex1(int hDeg, int sPercent, int lPercent)
{
    double hh = hDeg/360.;
    double ss = sPercent/100.;
    double ll = lPercent/100.;
    DWORD dw = HSLtoRGB(hh, ss, ll);
    int nRed = GetRValue(dw);
    int nGreen = GetGValue(dw);
    int nBlue = GetBValue(dw);
    printf("%d %d %d\n", nRed, nGreen, nBlue);
}

Remark

See Also

RGBtoHSL

header to Included

origin.h

Reference