HLS

RGB <-> HLS conversion based on http://support.microsoft.com/kb/29240

Members

Aliases

RGBTYPE
alias RGBTYPE = COLOR.ChannelType
Undocumented in source.

Manifest constants

RGBMAX
enum RGBMAX;
Undocumented in source.
UNDEFINED
enum UNDEFINED;

Hue is undefined if Saturation is 0 (grey-scale) This value determines where the Hue scrollbar is initially set for achromatic colors

Static functions

fromHLS
COLOR fromHLS(HLSTYPE hue, HLSTYPE lum, HLSTYPE sat)

Convert HLS to RGB.

toHLS
void toHLS(COLOR rgb, HLSTYPE h, HLSTYPE l, HLSTYPE s)

Convert RGB to HLS.

Examples

import ae.utils.graphics.color;
HLS!RGB hls;
auto red = hls.fromHLS(0, 120, 240);
assert(red == RGB(255, 0, 0));
ushort h,l,s;
hls.toHLS(red, h, l, s);
assert(h==0 && l==120 && s==240);

Meta