Share via


CDrawingManager::RGBtoHSL

Converts a color from a red, green, and blue (RGB) representation to a hue, saturation, and lightness (HSL) representation.

static void __stdcall RGBtoHSL(
   COLORREF rgb,
   double *H,
   double *S,
   double *L
);

Parameters

Parameter

Description

[in] rgb

The color in RGB values.

[out] H

A pointer to a double where the method stores the hue for the color.

[out] S

A pointer to a double where the method stores the saturation for the color.

[out] L

A pointer to a double where the method stores the lightness for the color.

Remarks

A color can be represented as HSV (hue, saturation, and value), HSL (hue, saturation, and luminosity), or RGB (red, green, and blue). For more information about the different representations of color, see Color.

The returned value for H is represented as a fraction between 0 and 1 where both 0 and 1 represent red. The returned values for S and L are numbers between 0 and 1.

Requirements

Header: afxdrawmanager.h

See Also

Reference

CDrawingManager Class

Hierarchy Chart

CDrawingManager::HLStoRGB_ONE

CDrawingManager::HLStoRGB_TWO